  MODULE jab_mod
    use physics_const_mod
    use params_mod
    use math_mod
    implicit none
    
    private
    
    public AUSM_jab, dpdq_mtx
    
    real(r_kind), parameter :: alpha   = 0.1875_r_kind
    real(r_kind), parameter :: beta    = 0.125_r_kind
    real(r_kind), parameter :: sigma   = 1
    real(r_kind), parameter :: Ku      = 0.75_r_kind
    real(r_kind), parameter :: Kp      = 0.25_r_kind
    real(r_kind), parameter :: epsilon = 1.e-16
  
    contains
    subroutine AUSM_jab(dFdqL,dFdqR,sqrtGL,sqrtGR,sqrtGhL,sqrtGhR,sqrtGvL,sqrtGvR,iGL,iGR,iGvL,iGvR,qN,qP)
      real(r_kind), dimension(nVar,nVar), intent(out) :: dFdqL,dFdqR
      real(r_kind)                      , intent(in ) :: sqrtGL,sqrtGR
      real(r_kind)                      , intent(in ) :: sqrtGhL,sqrtGhR
      real(r_kind)                      , intent(in ) :: sqrtGvL,sqrtGvR
      real(r_kind), dimension(3,3)      , intent(in ) :: iGL,iGR
      real(r_kind), dimension(2,3:3)    , intent(in ) :: iGvL,iGvR
      real(r_kind), dimension(nVar     ), intent(in ) :: qN,qP
      
      real(r_kind) :: qL1,qL2,qL3,qL4,qL5,qL6
      real(r_kind) :: qR1,qR2,qR3,qR4,qR5,qR6
      real(r_kind) :: iGL1_3
      real(r_kind) :: iGL2_3
      real(r_kind) :: iGR1_3
      real(r_kind) :: iGR2_3
      real(r_kind) :: iGvL1_3
      real(r_kind) :: iGvL2_3
      real(r_kind) :: iGvR1_3
      real(r_kind) :: iGvR2_3
      
      real(r_kind) :: &
      t2     ,&
      t3     ,&
      t4     ,&
      t5     ,&
      t6     ,&
      t7     ,&
      t8     ,&
      t9     ,&
      t10    ,&
      t11    ,&
      t16    ,&
      t17    ,&
      t18    ,&
      t19    ,&
      t22    ,&
      t25    ,&
      t26    ,&
      t27    ,&
      t28    ,&
      t12    ,&
      t13    ,&
      t14    ,&
      t15    ,&
      t20    ,&
      t21    ,&
      t23    ,&
      t24    ,&
      t29    ,&
      t30    ,&
      t31    ,&
      t32    ,&
      t33    ,&
      t34    ,&
      t35    ,&
      t36    ,&
      t39    ,&
      t40    ,&
      t51    ,&
      t52    ,&
      t61    ,&
      t62    ,&
      t69    ,&
      t70    ,&
      t37    ,&
      t38    ,&
      t41    ,&
      t42    ,&
      t43    ,&
      t45    ,&
      t47    ,&
      t48    ,&
      t49    ,&
      t50    ,&
      t53    ,&
      t54    ,&
      t55    ,&
      t56    ,&
      t71    ,&
      t72    ,&
      t97    ,&
      t113   ,&
      t44    ,&
      t46    ,&
      t57    ,&
      t58    ,&
      t59    ,&
      t60    ,&
      t63    ,&
      t64    ,&
      t65    ,&
      t67    ,&
      t73    ,&
      t74    ,&
      t138   ,&
      t66    ,&
      t68    ,&
      t75    ,&
      t77    ,&
      t79    ,&
      t80    ,&
      t81    ,&
      t82    ,&
      t83    ,&
      t84    ,&
      t85    ,&
      t86    ,&
      t87    ,&
      t88    ,&
      t89    ,&
      t90    ,&
      t92    ,&
      t93    ,&
      t95    ,&
      t96    ,&
      t107   ,&
      t108   ,&
      t109   ,&
      t110   ,&
      t114   ,&
      t115   ,&
      t117   ,&
      t118   ,&
      t120   ,&
      t121   ,&
      t123   ,&
      t124   ,&
      t139   ,&
      t76    ,&
      t78    ,&
      t91    ,&
      t94    ,&
      t100   ,&
      t101   ,&
      t102   ,&
      t103   ,&
      t104   ,&
      t105   ,&
      t106   ,&
      t116   ,&
      t119   ,&
      t122   ,&
      t125   ,&
      t126   ,&
      t128   ,&
      t130   ,&
      t132   ,&
      t134   ,&
      t135   ,&
      t136   ,&
      t137   ,&
      t98    ,&
      t99    ,&
      t111   ,&
      t112   ,&
      t127   ,&
      t129   ,&
      t131   ,&
      t133   ,&
      t140   ,&
      t141   ,&
      t142   ,&
      t143   ,&
      t144   ,&
      t145   ,&
      t146   ,&
      t147   ,&
      t152   ,&
      t153   ,&
      t157   ,&
      t159   ,&
      t164   ,&
      t165   ,&
      t148   ,&
      t150   ,&
      t154   ,&
      t155   ,&
      t156   ,&
      t158   ,&
      t160   ,&
      t161   ,&
      t166   ,&
      t167   ,&
      t168   ,&
      t169   ,&
      t170   ,&
      t171   ,&
      t172   ,&
      t173   ,&
      t174   ,&
      t175   ,&
      t149   ,&
      t151   ,&
      t162   ,&
      t163   ,&
      t176   ,&
      t177   ,&
      t178   ,&
      t179   ,&
      t180   ,&
      t181   ,&
      t184   ,&
      t185   ,&
      t186   ,&
      t187   ,&
      t182   ,&
      t183   ,&
      t188   ,&
      t189   ,&
      t190   ,&
      t191   ,&
      t197   ,&
      t198   ,&
      t201   ,&
      t202   ,&
      t227   ,&
      t228   ,&
      t192   ,&
      t193   ,&
      t194   ,&
      t195   ,&
      t199   ,&
      t200   ,&
      t203   ,&
      t204   ,&
      t196   ,&
      t205   ,&
      t206   ,&
      t207   ,&
      t208   ,&
      t209   ,&
      t210   ,&
      t211   ,&
      t212   ,&
      t213   ,&
      t214   ,&
      t215   ,&
      t216   ,&
      t221   ,&
      t222   ,&
      t225   ,&
      t226   ,&
      t233   ,&
      t234   ,&
      t235   ,&
      t236   ,&
      t238   ,&
      t239   ,&
      t276   ,&
      t277   ,&
      t217   ,&
      t218   ,&
      t219   ,&
      t220   ,&
      t237   ,&
      t240   ,&
      t241   ,&
      t291   ,&
      t292   ,&
      t342   ,&
      t343   ,&
      t344   ,&
      t345   ,&
      t223   ,&
      t224   ,&
      t229   ,&
      t230   ,&
      t349   ,&
      t350   ,&
      t382   ,&
      t383   ,&
      t400   ,&
      t401   ,&
      t424   ,&
      t425   ,&
      t231   ,&
      t232   ,&
      t242   ,&
      t460   ,&
      t461   ,&
      t464   ,&
      t465   ,&
      t243   ,&
      t244   ,&
      t245   ,&
      t252   ,&
      t246   ,&
      t247   ,&
      t249   ,&
      t250   ,&
      t253   ,&
      t254   ,&
      t255   ,&
      t272   ,&
      t273   ,&
      t274   ,&
      t275   ,&
      t248   ,&
      t251   ,&
      t256   ,&
      t257   ,&
      t258   ,&
      t259   ,&
      t260   ,&
      t261   ,&
      t262   ,&
      t263   ,&
      t278   ,&
      t279   ,&
      t280   ,&
      t281   ,&
      t282   ,&
      t283   ,&
      t284   ,&
      t285   ,&
      t286   ,&
      t287   ,&
      t288   ,&
      t289   ,&
      t290   ,&
      t293   ,&
      t294   ,&
      t301   ,&
      t302   ,&
      t308   ,&
      t309   ,&
      t319   ,&
      t320   ,&
      t334   ,&
      t406   ,&
      t407   ,&
      t408   ,&
      t409   ,&
      t411   ,&
      t413   ,&
      t415   ,&
      t417   ,&
      t513   ,&
      t514   ,&
      t515   ,&
      t516   ,&
      t518   ,&
      t520   ,&
      t522   ,&
      t524   ,&
      t527   ,&
      t528   ,&
      t537   ,&
      t538   ,&
      t539   ,&
      t540   ,&
      t542   ,&
      t544   ,&
      t545   ,&
      t546   ,&
      t547   ,&
      t548   ,&
      t552   ,&
      t553   ,&
      t264   ,&
      t265   ,&
      t266   ,&
      t267   ,&
      t268   ,&
      t269   ,&
      t270   ,&
      t271   ,&
      t295   ,&
      t296   ,&
      t297   ,&
      t298   ,&
      t299   ,&
      t300   ,&
      t303   ,&
      t304   ,&
      t306   ,&
      t314   ,&
      t315   ,&
      t316   ,&
      t317   ,&
      t322   ,&
      t323   ,&
      t326   ,&
      t327   ,&
      t339   ,&
      t357   ,&
      t363   ,&
      t366   ,&
      t410   ,&
      t412   ,&
      t414   ,&
      t416   ,&
      t432   ,&
      t433   ,&
      t434   ,&
      t435   ,&
      t451   ,&
      t453   ,&
      t454   ,&
      t455   ,&
      t517   ,&
      t519   ,&
      t521   ,&
      t523   ,&
      t525   ,&
      t526   ,&
      t529   ,&
      t530   ,&
      t541   ,&
      t543   ,&
      t600   ,&
      t601   ,&
      t603   ,&
      t604   ,&
      t605   ,&
      t607   ,&
      t615   ,&
      t617   ,&
      t626   ,&
      t627   ,&
      t628   ,&
      t629   ,&
      t630   ,&
      t631   ,&
      t633   ,&
      t634   ,&
      t635   ,&
      t639   ,&
      t641   ,&
      t646   ,&
      t647   ,&
      t305   ,&
      t307   ,&
      t310   ,&
      t311   ,&
      t312   ,&
      t313   ,&
      t318   ,&
      t325   ,&
      t328   ,&
      t330   ,&
      t340   ,&
      t341   ,&
      t351   ,&
      t352   ,&
      t353   ,&
      t354   ,&
      t355   ,&
      t356   ,&
      t358   ,&
      t359   ,&
      t360   ,&
      t361   ,&
      t362   ,&
      t364   ,&
      t365   ,&
      t367   ,&
      t368   ,&
      t370   ,&
      t371   ,&
      t372   ,&
      t373   ,&
      t374   ,&
      t438   ,&
      t439   ,&
      t448   ,&
      t449   ,&
      t450   ,&
      t452   ,&
      t590   ,&
      t591   ,&
      t602   ,&
      t606   ,&
      t608   ,&
      t609   ,&
      t610   ,&
      t611   ,&
      t612   ,&
      t613   ,&
      t614   ,&
      t616   ,&
      t618   ,&
      t624   ,&
      t625   ,&
      t632   ,&
      t636   ,&
      t637   ,&
      t638   ,&
      t640   ,&
      t696   ,&
      t697   ,&
      t731   ,&
      t732   ,&
      t870   ,&
      t872   ,&
      t911   ,&
      t321   ,&
      t324   ,&
      t329   ,&
      t331   ,&
      t332   ,&
      t333   ,&
      t346   ,&
      t369   ,&
      t375   ,&
      t376   ,&
      t377   ,&
      t378   ,&
      t379   ,&
      t380   ,&
      t381   ,&
      t384   ,&
      t385   ,&
      t386   ,&
      t387   ,&
      t388   ,&
      t389   ,&
      t429   ,&
      t456   ,&
      t457   ,&
      t458   ,&
      t459   ,&
      t531   ,&
      t532   ,&
      t533   ,&
      t534   ,&
      t535   ,&
      t536   ,&
      t592   ,&
      t593   ,&
      t619   ,&
      t620   ,&
      t621   ,&
      t622   ,&
      t623   ,&
      t642   ,&
      t643   ,&
      t644   ,&
      t645   ,&
      t692   ,&
      t693   ,&
      t723   ,&
      t724   ,&
      t780   ,&
      t781   ,&
      t782   ,&
      t783   ,&
      t871   ,&
      t873   ,&
      t906   ,&
      t907   ,&
      t912   ,&
      t940   ,&
      t941   ,&
      t946   ,&
      t947   ,&
      t1033  ,&
      t1034  ,&
      t335   ,&
      t337   ,&
      t347   ,&
      t390   ,&
      t391   ,&
      t428   ,&
      t430   ,&
      t431   ,&
      t436   ,&
      t437   ,&
      t446   ,&
      t447   ,&
      t582   ,&
      t583   ,&
      t584   ,&
      t585   ,&
      t586   ,&
      t587   ,&
      t588   ,&
      t589   ,&
      t725   ,&
      t726   ,&
      t727   ,&
      t728   ,&
      t733   ,&
      t734   ,&
      t735   ,&
      t736   ,&
      t784   ,&
      t785   ,&
      t799   ,&
      t800   ,&
      t801   ,&
      t802   ,&
      t1007  ,&
      t1008  ,&
      t336   ,&
      t338   ,&
      t348   ,&
      t392   ,&
      t393   ,&
      t394   ,&
      t395   ,&
      t396   ,&
      t397   ,&
      t398   ,&
      t399   ,&
      t418   ,&
      t419   ,&
      t420   ,&
      t421   ,&
      t422   ,&
      t423   ,&
      t426   ,&
      t440   ,&
      t441   ,&
      t442   ,&
      t443   ,&
      t444   ,&
      t445   ,&
      t462   ,&
      t463   ,&
      t492   ,&
      t493   ,&
      t494   ,&
      t495   ,&
      t567   ,&
      t568   ,&
      t580   ,&
      t581   ,&
      t694   ,&
      t695   ,&
      t698   ,&
      t699   ,&
      t700   ,&
      t701   ,&
      t717   ,&
      t718   ,&
      t729   ,&
      t730   ,&
      t737   ,&
      t738   ,&
      t776   ,&
      t777   ,&
      t778   ,&
      t779   ,&
      t915   ,&
      t916   ,&
      t917   ,&
      t918   ,&
      t944   ,&
      t945   ,&
      t948   ,&
      t949   ,&
      t402   ,&
      t403   ,&
      t404   ,&
      t405   ,&
      t427   ,&
      t478   ,&
      t479   ,&
      t480   ,&
      t481   ,&
      t482   ,&
      t483   ,&
      t484   ,&
      t485   ,&
      t488   ,&
      t489   ,&
      t501   ,&
      t502   ,&
      t503   ,&
      t504   ,&
      t505   ,&
      t506   ,&
      t578   ,&
      t579   ,&
      t596   ,&
      t597   ,&
      t651   ,&
      t652   ,&
      t653   ,&
      t654   ,&
      t655   ,&
      t656   ,&
      t657   ,&
      t658   ,&
      t786   ,&
      t787   ,&
      t788   ,&
      t789   ,&
      t803   ,&
      t804   ,&
      t805   ,&
      t806   ,&
      t815   ,&
      t816   ,&
      t825   ,&
      t826   ,&
      t829   ,&
      t830   ,&
      t840   ,&
      t841   ,&
      t466   ,&
      t467   ,&
      t468   ,&
      t469   ,&
      t470   ,&
      t471   ,&
      t472   ,&
      t473   ,&
      t474   ,&
      t475   ,&
      t476   ,&
      t477   ,&
      t486   ,&
      t487   ,&
      t490   ,&
      t491   ,&
      t496   ,&
      t497   ,&
      t499   ,&
      t500   ,&
      t507   ,&
      t508   ,&
      t509   ,&
      t510   ,&
      t511   ,&
      t512   ,&
      t549   ,&
      t550   ,&
      t554   ,&
      t555   ,&
      t557   ,&
      t558   ,&
      t559   ,&
      t560   ,&
      t561   ,&
      t564   ,&
      t565   ,&
      t566   ,&
      t569   ,&
      t570   ,&
      t571   ,&
      t572   ,&
      t573   ,&
      t574   ,&
      t575   ,&
      t576   ,&
      t594   ,&
      t595   ,&
      t598   ,&
      t599   ,&
      t648   ,&
      t649   ,&
      t659   ,&
      t660   ,&
      t663   ,&
      t664   ,&
      t665   ,&
      t666   ,&
      t667   ,&
      t668   ,&
      t669   ,&
      t670   ,&
      t673   ,&
      t674   ,&
      t675   ,&
      t676   ,&
      t677   ,&
      t678   ,&
      t679   ,&
      t680   ,&
      t681   ,&
      t682   ,&
      t683   ,&
      t684   ,&
      t685   ,&
      t702   ,&
      t703   ,&
      t704   ,&
      t705   ,&
      t706   ,&
      t707   ,&
      t708   ,&
      t709   ,&
      t711   ,&
      t712   ,&
      t713   ,&
      t714   ,&
      t719   ,&
      t720   ,&
      t721   ,&
      t722   ,&
      t739   ,&
      t740   ,&
      t742   ,&
      t743   ,&
      t744   ,&
      t745   ,&
      t754   ,&
      t755   ,&
      t758   ,&
      t759   ,&
      t790   ,&
      t791   ,&
      t793   ,&
      t794   ,&
      t795   ,&
      t796   ,&
      t807   ,&
      t808   ,&
      t809   ,&
      t810   ,&
      t811   ,&
      t812   ,&
      t813   ,&
      t814   ,&
      t817   ,&
      t818   ,&
      t827   ,&
      t828   ,&
      t831   ,&
      t832   ,&
      t833   ,&
      t834   ,&
      t836   ,&
      t837   ,&
      t838   ,&
      t839   ,&
      t842   ,&
      t843   ,&
      t844   ,&
      t845   ,&
      t846   ,&
      t847   ,&
      t849   ,&
      t850   ,&
      t858   ,&
      t859   ,&
      t860   ,&
      t861   ,&
      t864   ,&
      t865   ,&
      t866   ,&
      t867   ,&
      t874   ,&
      t875   ,&
      t876   ,&
      t877   ,&
      t878   ,&
      t879   ,&
      t880   ,&
      t882   ,&
      t886   ,&
      t887   ,&
      t888   ,&
      t889   ,&
      t908   ,&
      t909   ,&
      t913   ,&
      t914   ,&
      t923   ,&
      t924   ,&
      t926   ,&
      t927   ,&
      t928   ,&
      t929   ,&
      t930   ,&
      t931   ,&
      t933   ,&
      t934   ,&
      t935   ,&
      t936   ,&
      t937   ,&
      t960   ,&
      t963   ,&
      t964   ,&
      t967   ,&
      t969   ,&
      t970   ,&
      t971   ,&
      t976   ,&
      t977   ,&
      t981   ,&
      t983   ,&
      t995   ,&
      t996   ,&
      t997   ,&
      t1047  ,&
      t1049  ,&
      t1050  ,&
      t1052  ,&
      t498   ,&
      t551   ,&
      t556   ,&
      t562   ,&
      t563   ,&
      t577   ,&
      t650   ,&
      t661   ,&
      t662   ,&
      t671   ,&
      t672   ,&
      t686   ,&
      t687   ,&
      t688   ,&
      t689   ,&
      t690   ,&
      t691   ,&
      t710   ,&
      t715   ,&
      t716   ,&
      t741   ,&
      t746   ,&
      t747   ,&
      t748   ,&
      t749   ,&
      t752   ,&
      t753   ,&
      t756   ,&
      t757   ,&
      t763   ,&
      t764   ,&
      t767   ,&
      t768   ,&
      t772   ,&
      t773   ,&
      t792   ,&
      t797   ,&
      t798   ,&
      t835   ,&
      t848   ,&
      t851   ,&
      t852   ,&
      t853   ,&
      t854   ,&
      t855   ,&
      t862   ,&
      t868   ,&
      t869   ,&
      t881   ,&
      t883   ,&
      t890   ,&
      t891   ,&
      t892   ,&
      t893   ,&
      t894   ,&
      t895   ,&
      t896   ,&
      t897   ,&
      t900   ,&
      t901   ,&
      t902   ,&
      t903   ,&
      t910   ,&
      t919   ,&
      t920   ,&
      t921   ,&
      t922   ,&
      t925   ,&
      t932   ,&
      t938   ,&
      t939   ,&
      t942   ,&
      t943   ,&
      t950   ,&
      t951   ,&
      t953   ,&
      t954   ,&
      t955   ,&
      t956   ,&
      t957   ,&
      t958   ,&
      t961   ,&
      t962   ,&
      t965   ,&
      t966   ,&
      t968   ,&
      t972   ,&
      t978   ,&
      t982   ,&
      t984   ,&
      t985   ,&
      t994   ,&
      t999   ,&
      t1048  ,&
      t1051  ,&
      t1113  ,&
      t750   ,&
      t751   ,&
      t760   ,&
      t761   ,&
      t762   ,&
      t769   ,&
      t770   ,&
      t771   ,&
      t819   ,&
      t820   ,&
      t821   ,&
      t822   ,&
      t823   ,&
      t824   ,&
      t856   ,&
      t857   ,&
      t863   ,&
      t884   ,&
      t885   ,&
      t898   ,&
      t899   ,&
      t904   ,&
      t905   ,&
      t952   ,&
      t959   ,&
      t973   ,&
      t974   ,&
      t979   ,&
      t980   ,&
      t986   ,&
      t987   ,&
      t989   ,&
      t990   ,&
      t991   ,&
      t992   ,&
      t998   ,&
      t1000  ,&
      t1001  ,&
      t1002  ,&
      t1004  ,&
      t1005  ,&
      t1009  ,&
      t1016  ,&
      t1017  ,&
      t1035  ,&
      t1036  ,&
      t1060  ,&
      t1062  ,&
      t1063  ,&
      t1100  ,&
      t1101  ,&
      t1110  ,&
      t1112  ,&
      t765   ,&
      t766   ,&
      t774   ,&
      t775   ,&
      t975   ,&
      t988   ,&
      t993   ,&
      t1003  ,&
      t1006  ,&
      t1010  ,&
      t1011  ,&
      t1012  ,&
      t1013  ,&
      t1018  ,&
      t1019  ,&
      t1021  ,&
      t1022  ,&
      t1023  ,&
      t1024  ,&
      t1029  ,&
      t1030  ,&
      t1037  ,&
      t1043  ,&
      t1044  ,&
      t1053  ,&
      t1054  ,&
      t1056  ,&
      t1057  ,&
      t1059  ,&
      t1061  ,&
      t1066  ,&
      t1067  ,&
      t1068  ,&
      t1069  ,&
      t1102  ,&
      t1103  ,&
      t1111  ,&
      t1120  ,&
      t1122  ,&
      t1136  ,&
      t1137  ,&
      t1152  ,&
      t1156  ,&
      t1014  ,&
      t1015  ,&
      t1020  ,&
      t1025  ,&
      t1026  ,&
      t1027  ,&
      t1028  ,&
      t1031  ,&
      t1032  ,&
      t1038  ,&
      t1039  ,&
      t1045  ,&
      t1046  ,&
      t1055  ,&
      t1058  ,&
      t1064  ,&
      t1065  ,&
      t1070  ,&
      t1071  ,&
      t1121  ,&
      t1123  ,&
      t1138  ,&
      t1139  ,&
      t1153  ,&
      t1154  ,&
      t1157  ,&
      t1158  ,&
      t1040  ,&
      t1144  ,&
      t1145  ,&
      t1155  ,&
      t1159  ,&
      t1165  ,&
      t1171  ,&
      t1041  ,&
      t1166  ,&
      t1172  ,&
      t1042  ,&
      t1072  ,&
      t1094  ,&
      t1095  ,&
      t1096  ,&
      t1097  ,&
      t1098  ,&
      t1099  ,&
      t1104  ,&
      t1105  ,&
      t1106  ,&
      t1107  ,&
      t1108  ,&
      t1109  ,&
      t1140  ,&
      t1142  ,&
      t1162  ,&
      t1163  ,&
      t1167  ,&
      t1169  ,&
      t1073  ,&
      t1074  ,&
      t1075  ,&
      t1124  ,&
      t1125  ,&
      t1128  ,&
      t1129  ,&
      t1130  ,&
      t1131  ,&
      t1141  ,&
      t1143  ,&
      t1160  ,&
      t1161  ,&
      t1164  ,&
      t1168  ,&
      t1170  ,&
      t1173  ,&
      t1175  ,&
      t1176  ,&
      t1177  ,&
      t1076  ,&
      t1077  ,&
      t1078  ,&
      t1079  ,&
      t1080  ,&
      t1081  ,&
      t1082  ,&
      t1083  ,&
      t1084  ,&
      t1085  ,&
      t1086  ,&
      t1087  ,&
      t1126  ,&
      t1127  ,&
      t1132  ,&
      t1133  ,&
      t1134  ,&
      t1135  ,&
      t1174  ,&
      t1178  ,&
      t1179  ,&
      t1181  ,&
      t1182  ,&
      t1183  ,&
      t1088  ,&
      t1089  ,&
      t1090  ,&
      t1091  ,&
      t1092  ,&
      t1093  ,&
      t1146  ,&
      t1147  ,&
      t1148  ,&
      t1149  ,&
      t1150  ,&
      t1151  ,&
      t1180  ,&
      t1114  ,&
      t1115  ,&
      t1116  ,&
      t1117  ,&
      t1118  ,&
      t1119
      
      qL1 = qN(1)
      qL2 = qN(2)
      qL3 = qN(3)
      qL4 = qN(4)
      qL5 = qN(5)
      qL6 = qN(6)
      
      qR1 = qP(1)
      qR2 = qP(2)
      qR3 = qP(3)
      qR4 = qP(4)
      qR5 = qP(5)
      qR6 = qP(6)
      
      iGL1_3 = iGL(1,3)
      iGL2_3 = iGL(2,3)
      iGR1_3 = iGR(1,3)
      iGR2_3 = iGR(2,3)
      
      iGvL1_3 = iGvL(1,3)
      iGvL2_3 = iGvL(2,3)
      iGvR1_3 = iGvR(1,3)
      iGvR2_3 = iGvR(2,3)
      
      t2 = iGvL1_3*qL2
      t3 = iGvL2_3*qL3
      t4 = iGvR1_3*qR2
      t5 = iGvR2_3*qR3
      t6 = qL1+qL6
      t7 = qR1+qR6
      t8 = qL4*2.0
      t9 = qL6*qL6
      t10 = qR4*2.0
      t11 = qR6*qR6
      t16 = -cpv
      t17 = -cvv
      t18 = 1.0/p0
      t19 = 1.0/qL1
      t22 = 1.0/qR1
      t25 = 1.0/sqrtGL
      t26 = 1.0/sqrtGR
      t27 = 1.0/sqrtGvL
      t28 = 1.0/sqrtGvR
      t12 = abs(t6)
      t13 = abs(t7)
      t14 = merge( 0._r_kind, sign(1._r_kind,t6), t6==0 )!(t6/abs(t6))
      t15 = merge( 0._r_kind, sign(1._r_kind,t7), t7==0 )!(t7/abs(t7))
      t20 = t19*t19
      t21 = t19*t19*t19
      t23 = t22*t22
      t24 = t22*t22*t22
      t29 = iGL1_3*t6
      t30 = iGL2_3*t6
      t31 = iGR1_3*t7
      t32 = iGR2_3*t7
      t33 = cpd+t16
      t34 = cvd+t17
      t35 = qL6*t19
      t36 = 1.0/t6
      t39 = qR6*t22
      t40 = 1.0/t7
      t51 = t2+t3
      t52 = t4+t5
      t61 = sqrtGhL*t6*t25
      t62 = sqrtGhR*t7*t26
      t69 = (t6*t25)/2.0
      t70 = (t7*t26)/2.0
      t37 = t36*t36
      t38 = t36*t36*t36
      t41 = t40*t40
      t42 = t40*t40*t40
      t43 = 1.0/t12
      t45 = 1.0/t13
      t47 = cpv*t35
      t48 = cvv*t35
      t49 = cpv*t39
      t50 = cvv*t39
      t53 = t35+1.0
      t54 = t39+1.0
      t55 = sqrtGvL*t51
      t56 = sqrtGvR*t52
      t71 = t29+t31
      t72 = t30+t32
      t97 = t61+t62
      t113 = t69+t70
      t44 = t43*t43
      t46 = t45*t45
      t57 = cpd+t47
      t58 = cpd+t49
      t59 = cvd+t48
      t60 = cvd+t50
      t63 = t55*2.0
      t64 = t56*2.0
      t65 = 1.0/t53
      t67 = 1.0/t54
      t73 = qL4+t55
      t74 = qR4+t56
      t138 = 1.0/t113
      t66 = t65*t65
      t68 = t67*t67
      t75 = 1.0/t59
      t77 = 1.0/t60
      t79 = abs(t73)
      t80 = abs(t74)
      t81 = merge( 0._r_kind, sign(1._r_kind,t73), t73==0 )!(t73/abs(t73))
      t82 = merge( 0._r_kind, sign(1._r_kind,t74), t74==0 )!(t74/abs(t74))
      t83 = t73*t73
      t84 = t74*t74
      t85 = t8+t63
      t86 = t10+t64
      t87 = eqv*t19*t65
      t88 = eqv*t22*t67
      t89 = eqv*t35*t65
      t90 = eqv*qL6*t20*t65
      t92 = eqv*t39*t67
      t93 = eqv*qR6*t23*t67
      t95 = t36*t73
      t96 = t40*t74
      t107 = t19*t33*t65
      t108 = t19*t34*t65
      t109 = t22*t33*t67
      t110 = t22*t34*t67
      t114 = t33*t35*t65
      t115 = qL6*t20*t33*t65
      t117 = t34*t35*t65
      t118 = qL6*t20*t34*t65
      t120 = t33*t39*t67
      t121 = qR6*t23*t33*t67
      t123 = t34*t39*t67
      t124 = qR6*t23*t34*t67
      t139 = t138*t138
      t76 = t75*t75
      t78 = t77*t77
      t91 = eqv*qL6*t20*t66
      t94 = eqv*qR6*t23*t68
      t100 = -t96
      t101 = t89+1.0
      t102 = eqv*t9*t21*t66
      t103 = t92+1.0
      t104 = eqv*t11*t24*t68
      t105 = t37*t83
      t106 = t41*t84
      t116 = qL6*t20*t33*t66
      t119 = qL6*t20*t34*t66
      t122 = qR6*t23*t33*t68
      t125 = qR6*t23*t34*t68
      t126 = -t114
      t128 = -t117
      t130 = -t120
      t132 = -t123
      t134 = t9*t21*t33*t66
      t135 = t9*t21*t34*t66
      t136 = t11*t24*t33*t68
      t137 = t11*t24*t34*t68
      t98 = -t91
      t99 = -t94
      t111 = -t102
      t112 = -t104
      t127 = -t116
      t129 = -t119
      t131 = -t122
      t133 = -t125
      t140 = cpd+t126
      t141 = cvd+t128
      t142 = cpd+t130
      t143 = cvd+t132
      t144 = -t134
      t145 = -t135
      t146 = -t136
      t147 = -t137
      t152 = Rd*qL5*t18*t19*t25*t101
      t153 = Rd*qR5*t18*t22*t26*t103
      t157 = Rd*qL5*t6*t18*t20*t25*t101
      t159 = Rd*qR5*t7*t18*t23*t26*t103
      t164 = t95+t100
      t165 = t105+t106
      t148 = 1.0/t141
      t150 = 1.0/t143
      t154 = -t152
      t155 = -t153
      t156 = t6*t152
      t158 = t7*t153
      t160 = t87+t98
      t161 = t88+t99
      t166 = t90+t111
      t167 = t93+t112
      t168 = t107+t127
      t169 = t108+t129
      t170 = t109+t131
      t171 = t110+t133
      t172 = t115+t144
      t173 = t118+t145
      t174 = t121+t146
      t175 = t124+t147
      t149 = t148*t148
      t151 = t150*t150
      t162 = log(t156)
      t163 = log(t158)
      t176 = Rd*qL5*t6*t18*t19*t25*t160
      t177 = Rd*qR5*t7*t18*t22*t26*t161
      t178 = t140*t148
      t179 = t142*t150
      t180 = Rd*qL5*t6*t18*t19*t25*t166
      t181 = Rd*qR5*t7*t18*t22*t26*t167
      t184 = t148*t168
      t185 = t150*t170
      t186 = t148*t172
      t187 = t150*t174
      t182 = t178-1.0
      t183 = t179-1.0
      t188 = t152+t176
      t189 = t153+t177
      t190 = pow(t156,t178)
      t191 = pow(t158,t179)
      t197 = t140*t149*t169
      t198 = t142*t151*t171
      t201 = t140*t149*t173
      t202 = t142*t151*t175
      t227 = t154+t157+t180
      t228 = t155+t159+t181
      t192 = p0*t190
      t193 = p0*t191
      t194 = pow(t156,t182)
      t195 = pow(t158,t183)
      t199 = -t197
      t200 = -t198
      t203 = -t201
      t204 = -t202
      t196 = -t193
      t205 = cpv*sqrtGL*t19*t36*t75*t192
      t206 = cpv*sqrtGR*t22*t40*t77*t193
      t207 = cpv*qL6*sqrtGL*t20*t36*t75*t192
      t208 = cpv*qR6*sqrtGR*t23*t40*t77*t193
      t209 = sqrtGL*t16*t19*t36*t75*t192
      t210 = sqrtGR*t16*t22*t40*t77*t193
      t211 = qL6*sqrtGL*t16*t20*t36*t75*t192
      t212 = qR6*sqrtGR*t16*t23*t40*t77*t193
      t213 = sqrtGL*t36*t57*t75*t192
      t214 = sqrtGL*t37*t57*t75*t192
      t215 = sqrtGR*t40*t58*t77*t193
      t216 = sqrtGR*t41*t58*t77*t193
      t221 = cvv*sqrtGL*t19*t36*t57*t76*t192
      t222 = cvv*sqrtGR*t22*t40*t58*t78*t193
      t225 = cvv*qL6*sqrtGL*t20*t36*t57*t76*t192
      t226 = cvv*qR6*sqrtGR*t23*t40*t58*t78*t193
      t233 = t184+t199
      t234 = t185+t200
      t235 = t186+t203
      t236 = t187+t204
      t238 = t178*t188*t194
      t239 = t179*t189*t195
      t276 = t178*t194*t227
      t277 = t179*t195*t228
      t217 = -t214
      t218 = sqrtGR*t41*t58*t77*t196
      t219 = sqrt(t213)
      t220 = sqrt(t215)
      t237 = t192+t196
      t240 = -t238
      t241 = -t239
      t291 = -t276
      t292 = -t277
      t342 = t162*t190*t233
      t343 = t163*t191*t234
      t344 = t162*t190*t235
      t345 = t163*t191*t236
      t223 = 1.0/t219
      t224 = 1.0/t220
      t229 = t219/2.0
      t230 = t220/2.0
      t349 = t240+t342
      t350 = t241+t343
      t382 = -p0*sqrtGL*t36*t57*t75*(t238-t342)
      t383 = -p0*sqrtGR*t40*t58*t77*(t239-t343)
      t400 = t291+t344
      t401 = t292+t345
      t424 = -p0*sqrtGL*t36*t57*t75*(t276-t344)
      t425 = -p0*sqrtGR*t40*t58*t77*(t277-t345)
      t231 = t27*t229
      t232 = t28*t230
      t242 = t229+t230
      t460 = t209+t214+t221+t382
      t461 = t210+t216+t222+t383
      t464 = t211+t217+t225+t424
      t465 = t212+t218+t226+t425
      t243 = abs(t242)
      t244 = merge( 0._r_kind, sign(1._r_kind,t242), t242==0 )!(t242/abs(t242))
      t245 = 1.0/t242
      t252 = t231+t232
      t246 = t245*t245
      t247 = t245*t245*t245
      t249 = t245*t245*t245*t245*t245
      t250 = 1.0/t243
      t253 = t252*t252
      t254 = t36*t245
      t255 = t40*t245
      t272 = t95*t245
      t273 = t37*t73*t245
      t274 = t96*t245
      t275 = t41*t74*t245
      t248 = t246*t246
      t251 = t250*t250
      t256 = iGvL1_3*sqrtGvL*t254
      t257 = iGvL2_3*sqrtGvL*t254
      t258 = iGvR1_3*sqrtGvR*t255
      t259 = iGvR2_3*sqrtGvR*t255
      t260 = -t254
      t261 = -t255
      t262 = t254/2.0
      t263 = t255/2.0
      t278 = -t272
      t279 = -t273
      t280 = -t275
      t281 = t272+1.0
      t282 = t274+1.0
      t283 = t272/2.0
      t284 = t273/2.0
      t285 = t274/2.0
      t286 = t275/2.0
      t287 = t43*t79*t250
      t288 = t45*t80*t250
      t289 = t272-1.0
      t290 = t274-1.0
      t293 = sigma*t38*t83*t246
      t294 = sigma*t42*t84*t246
      t301 = (t43*t81*t250)/2.0
      t302 = (t45*t82*t250)/2.0
      t308 = t14*t44*t79*t250
      t309 = t15*t46*t80*t250
      t319 = iGvR1_3*sqrtGvR*t45*t82*t250*(-1.0/2.0)
      t320 = iGvR2_3*sqrtGvR*t45*t82*t250*(-1.0/2.0)
      t334 = (sigma*t165*t246)/2.0
      t406 = (Rd*t19*t57*t75*t95*t101*t178*t194*t223*t246)/4.0
      t407 = (Rd*t19*t57*t75*t96*t101*t178*t194*t223*t246)/4.0
      t408 = (Rd*t22*t58*t77*t95*t103*t179*t195*t224*t246)/4.0
      t409 = (Rd*t22*t58*t77*t96*t103*t179*t195*t224*t246)/4.0
      t411 = (Rd*t19*t57*t75*t95*t101*t178*t194*t223*t246)/8.0
      t413 = (Rd*t19*t57*t75*t96*t101*t178*t194*t223*t246)/8.0
      t415 = (Rd*t22*t58*t77*t95*t103*t179*t195*t224*t246)/8.0
      t417 = (Rd*t22*t58*t77*t96*t103*t179*t195*t224*t246)/8.0
      t513 = (t95*t223*t246*t460)/4.0
      t514 = (t96*t223*t246*t460)/4.0
      t515 = (t95*t224*t246*t461)/4.0
      t516 = (t96*t224*t246*t461)/4.0
      t518 = (t95*t223*t246*t460)/8.0
      t520 = (t96*t223*t246*t460)/8.0
      t522 = (t95*t224*t246*t461)/8.0
      t524 = (t96*t224*t246*t461)/8.0
      t527 = (sigma*t165*t223*t247*t460)/4.0
      t528 = (sigma*t165*t224*t247*t461)/4.0
      t537 = (t95*t223*t246*t464)/4.0
      t538 = (t96*t223*t246*t464)/4.0
      t539 = t95*t224*t246*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)*(-1.0/4.0)
      t540 = t96*t224*t246*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)*(-1.0/4.0)
      t542 = (t95*t223*t246*t464)/8.0
      t544 = (t96*t223*t246*t464)/8.0
      t545 = (t95*t224*t246*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/4.0
      t546 = t95*t224*t246*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)*(-1.0/8.0)
      t547 = (t96*t224*t246*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/4.0
      t548 = t96*t224*t246*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)*(-1.0/8.0)
      t552 = (sigma*t165*t223*t247*t464)/4.0
      t553 = sigma*t165*t224*t247*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)*(-1.0/4.0)
      t264 = -t256
      t265 = -t257
      t266 = -t258
      t267 = -t259
      t268 = t256/2.0
      t269 = t257/2.0
      t270 = t258/2.0
      t271 = t259/2.0
      t295 = t281*t281
      t296 = t282*t282
      t297 = t289*t289
      t298 = t290*t290
      t299 = t287/2.0
      t300 = t288/2.0
      t303 = t287-1.0
      t304 = t288-1.0
      t306 = -t302
      t314 = iGvL1_3*sqrtGvL*t301
      t315 = iGvL2_3*sqrtGvL*t301
      t316 = iGvR1_3*sqrtGvR*t302
      t317 = iGvR2_3*sqrtGvR*t302
      t322 = t308/2.0
      t323 = t309/2.0
      t326 = t287+1.0E-15
      t327 = t288+1.0E-15
      t339 = t334-1.0
      t357 = t262+t301
      t363 = alpha*t41*t74*t246*t282*8.0
      t366 = alpha*t37*t73*t246*t289*8.0
      t410 = -t406
      t412 = -t407
      t414 = -t408
      t416 = -t409
      t432 = (Rd*t19*t43*t57*t75*t79*t101*t178*t194*t223*t244*t251)/8.0
      t433 = (Rd*t19*t45*t57*t75*t80*t101*t178*t194*t223*t244*t251)/8.0
      t434 = (Rd*t22*t43*t58*t77*t79*t103*t179*t195*t224*t244*t251)/8.0
      t435 = (Rd*t22*t45*t58*t77*t80*t103*t179*t195*t224*t244*t251)/8.0
      t451 = Rd*alpha*t19*t57*t75*t101*t106*t178*t194*t223*t247*t282*2.0
      t453 = Rd*alpha*t22*t58*t77*t103*t106*t179*t195*t224*t247*t282*2.0
      t454 = Rd*alpha*t19*t57*t75*t101*t105*t178*t194*t223*t247*t289*2.0
      t455 = Rd*alpha*t22*t58*t77*t103*t105*t179*t195*t224*t247*t289*2.0
      t517 = -t513
      t519 = -t514
      t521 = -t515
      t523 = -t516
      t525 = -t518
      t526 = -t524
      t529 = -t527
      t530 = -t528
      t541 = -t537
      t543 = -t538
      t600 = (t43*t79*t223*t244*t251*t460)/4.0
      t601 = (t45*t80*t224*t244*t251*t461)/4.0
      t603 = (t43*t79*t223*t244*t251*t460)/8.0
      t604 = (t45*t80*t223*t244*t251*t460)/8.0
      t605 = (t43*t79*t224*t244*t251*t461)/8.0
      t607 = (t45*t80*t224*t244*t251*t461)/8.0
      t615 = alpha*t106*t223*t247*t282*t460*2.0
      t617 = alpha*t105*t224*t247*t289*t461*2.0
      t626 = (t43*t79*t223*t244*t251*t464)/4.0
      t627 = t45*t80*t224*t244*t251*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)*(-1.0/4.0)
      t628 = (t43*t79*t223*t244*t251*t464)/8.0
      t629 = (t45*t80*t223*t244*t251*t464)/8.0
      t630 = t43*t79*t224*t244*t251*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)*(-1.0/8.0)
      t631 = t45*t80*t224*t244*t251*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)*(-1.0/8.0)
      t633 = (t45*t80*t224*t244*t251*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0
      t634 = t273+t537
      t635 = t275+t540
      t639 = alpha*t106*t223*t247*t282*t464*2.0
      t641 = alpha*t105*t224*t247*t289*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)*(-2.0)
      t646 = t293+t552
      t647 = t294+t553
      t305 = -t300
      t307 = beta*t296*4.0
      t310 = abs(t303)
      t311 = abs(t304)
      t312 = merge( 0._r_kind, sign(1._r_kind,t303), t303==0 )!(t303/abs(t303))
      t313 = merge( 0._r_kind, sign(1._r_kind,t304), t304==0 )!(t304/abs(t304))
      t318 = beta*t297*4.0
      t325 = -t323
      t328 = 1.0/t326
      t330 = 1.0/t327
      t340 = abs(t339)
      t341 = merge( 0._r_kind, sign(1._r_kind,t339), t339==0 )!(t339/abs(t339))
      t351 = alpha*t255*t296*4.0
      t352 = alpha*t254*t297*4.0
      t353 = alpha*t258*t296*4.0
      t354 = alpha*t259*t296*4.0
      t355 = alpha*t256*t297*4.0
      t356 = alpha*t257*t297*4.0
      t358 = t263+t306
      t359 = t268+t314
      t360 = t269+t315
      t361 = t270+t319
      t362 = t271+t320
      t364 = alpha*t274*t296*4.0
      t365 = alpha*t275*t296*4.0
      t367 = alpha*t272*t297*4.0
      t368 = alpha*t273*t297*4.0
      t370 = iGvR1_3*sqrtGvR*t363
      t371 = iGvR2_3*sqrtGvR*t363
      t372 = iGvL1_3*sqrtGvL*t366
      t373 = iGvL2_3*sqrtGvL*t366
      t374 = t283+t299
      t438 = -t433
      t439 = -t435
      t448 = Rd*alpha*t19*t57*t75*t96*t101*t178*t194*t223*t246*t296
      t449 = Rd*alpha*t22*t58*t77*t96*t103*t179*t195*t224*t246*t296
      t450 = Rd*alpha*t19*t57*t75*t95*t101*t178*t194*t223*t246*t297
      t452 = Rd*alpha*t22*t58*t77*t95*t103*t179*t195*t224*t246*t297
      t590 = t411+t432
      t591 = t415+t434
      t602 = -t600
      t606 = -t601
      t608 = -t603
      t609 = -t604
      t610 = alpha*t96*t223*t246*t296*t460
      t611 = alpha*t96*t224*t246*t296*t461
      t612 = t273+t517
      t613 = t275+t523
      t614 = alpha*t95*t223*t246*t297*t460
      t616 = alpha*t95*t224*t246*t297*t461
      t618 = alpha*t100*t224*t246*t296*t461
      t624 = t293+t529
      t625 = t294+t530
      t632 = -t629
      t636 = alpha*t96*t223*t246*t296*t464
      t637 = -alpha*t96*t224*t246*t296*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)
      t638 = alpha*t95*t223*t246*t297*t464
      t640 = -alpha*t95*t224*t246*t297*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)
      t696 = t308+t626
      t697 = t309+t627
      t731 = alpha*t274*t282*t635*8.0
      t732 = alpha*t272*t289*t634*8.0
      t870 = t522+t605
      t872 = t546+t630
      t911 = t284+t322+t542+t628
      t321 = t307+1.0
      t324 = t318+1.0
      t329 = t328*t328
      t331 = t330*t330
      t332 = t310+1.0E-15
      t333 = t311+1.0E-15
      t346 = t340+1.0E-15
      t369 = -t364
      t375 = t285+t305
      t376 = t262*t328
      t377 = t263*t330
      t378 = t268*t328
      t379 = t269*t328
      t380 = t270*t330
      t381 = t271*t330
      t384 = t283*t328
      t385 = t284*t328
      t386 = t285*t330
      t387 = t286*t330
      t388 = t273*t328*(-1.0/2.0)
      t389 = t275*t330*(-1.0/2.0)
      t429 = t278+t367+2.0
      t456 = t328*t411
      t457 = t330*t413
      t458 = t328*t415
      t459 = t330*t417
      t531 = t261+t351+t363
      t532 = t260+t352+t366
      t533 = t266+t353+t370
      t534 = t267+t354+t371
      t535 = t264+t355+t372
      t536 = t265+t356+t373
      t592 = t413+t438
      t593 = t417+t439
      t619 = -t614
      t620 = t328*t518
      t621 = t330*t520
      t622 = t328*t522
      t623 = t330*t524
      t642 = t328*t542
      t643 = t330*t544
      t644 = t328*t546
      t645 = t330*t548
      t692 = t308+t602
      t693 = t309+t606
      t723 = alpha*t274*t282*t613*8.0
      t724 = alpha*t272*t289*t612*8.0
      t780 = t412+t448+t451
      t781 = t416+t449+t453
      t782 = t410+t450+t454
      t783 = t414+t452+t455
      t871 = t520+t609
      t873 = t544+t632
      t906 = t284+t322+t525+t608
      t907 = t286+t325+t526+t607
      t912 = t286+t325+t548+t633
      t940 = t519+t610+t615
      t941 = t521+t616+t617
      t946 = t543+t636+t639
      t947 = t545+t640+t641
      t1033 = t280+t365+t547+t637+t731
      t1034 = t279+t368+t541+t638+t732
      t335 = 1.0/t332
      t337 = 1.0/t333
      t347 = 1.0/t346
      t390 = t384+1.0/2.0
      t391 = t386-1.0/2.0
      t428 = t282+t369+1.0
      t430 = t43*t81*t250*t283*t329
      t431 = t45*t82*t250*t285*t331
      t436 = t43*t81*t250*t272*t329*(-1.0/2.0)
      t437 = t45*t82*t250*t274*t331*(-1.0/2.0)
      t446 = t274*t319*t331
      t447 = t274*t320*t331
      t582 = t272*t329*t432
      t583 = t274*t331*t433
      t584 = t272*t329*t434
      t585 = t274*t331*t435
      t586 = Rd*t19*t43*t57*t75*t79*t101*t178*t194*t223*t244*t251*t272*t329*(-1.0/8.0)
      t587 = Rd*t19*t45*t57*t75*t80*t101*t178*t194*t223*t244*t251*t274*t331*(-1.0/8.0)
      t588 = Rd*t22*t43*t58*t77*t79*t103*t179*t195*t224*t244*t251*t272*t329*(-1.0/8.0)
      t589 = Rd*t22*t45*t58*t77*t80*t103*t179*t195*t224*t244*t251*t274*t331*(-1.0/8.0)
      t725 = t274*t331*t604
      t726 = t272*t329*t605
      t727 = t45*t80*t223*t244*t251*t274*t331*t460*(-1.0/8.0)
      t728 = t43*t79*t224*t244*t251*t272*t329*t461*(-1.0/8.0)
      t733 = t274*t331*t629
      t734 = t272*t329*t630
      t735 = t45*t80*t223*t244*t251*t274*t331*t464*(-1.0/8.0)
      t736 = (t43*t79*t224*t244*t251*t272*t329*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0
      t784 = t283*t329*t692
      t785 = t285*t331*t693
      t799 = t283*t329*t696
      t800 = t285*t331*t697
      t801 = t272*t329*t696*(-1.0/2.0)
      t802 = t274*t331*t697*(-1.0/2.0)
      t1007 = t280+t365+t516+t618+t723
      t1008 = t279+t368+t513+t619+t724
      t336 = t335*t335
      t338 = t337*t337
      t348 = t347*t347
      t392 = t301*t335
      t393 = t302*t337
      t394 = t314*t335
      t395 = t315*t335
      t396 = t316*t337
      t397 = t317*t337
      t398 = (t303*t335)/2.0
      t399 = (t304*t337)/2.0
      t418 = (iGvL1_3*sigma*sqrtGvL*t37*t73*t246*t347)/2.0
      t419 = (iGvL2_3*sigma*sqrtGvL*t37*t73*t246*t347)/2.0
      t420 = (iGvR1_3*sigma*sqrtGvR*t41*t74*t246*t347)/2.0
      t421 = (iGvR2_3*sigma*sqrtGvR*t41*t74*t246*t347)/2.0
      t422 = (sigma*t37*t85*t246*t347)/4.0
      t423 = (sigma*t41*t86*t246*t347)/4.0
      t426 = (t339*t347)/2.0
      t440 = iGvL1_3*sqrtGvL*t430
      t441 = iGvL2_3*sqrtGvL*t430
      t442 = iGvR1_3*sqrtGvR*t431
      t443 = iGvR2_3*sqrtGvR*t431
      t444 = iGvL1_3*sqrtGvL*t436
      t445 = iGvL2_3*sqrtGvL*t436
      t462 = (Rd*sigma*t19*t57*t75*t101*t165*t178*t194*t223*t247*t347)/8.0
      t463 = (Rd*sigma*t22*t58*t77*t103*t165*t179*t195*t224*t247*t347)/8.0
      t492 = t335*t432
      t493 = t337*t433
      t494 = t335*t434
      t495 = t337*t435
      t567 = t376+t436
      t568 = t377+t437
      t580 = t380+t446
      t581 = t381+t447
      t694 = t335*t605
      t695 = t337*t604
      t698 = t337*t629
      t699 = t335*t630
      t700 = (t347*t624)/2.0
      t701 = (t347*t625)/2.0
      t717 = (t347*t646)/2.0
      t718 = (t347*t647)/2.0
      t729 = (t335*t692)/2.0
      t730 = (t337*t693)/2.0
      t737 = (t335*t696)/2.0
      t738 = (t337*t697)/2.0
      t776 = t456+t586
      t777 = t457+t587
      t778 = t458+t588
      t779 = t459+t589
      t915 = t621+t727
      t916 = t622+t728
      t917 = t643+t735
      t918 = t644+t736
      t944 = t388+t620+t784
      t945 = t389+t623+t785
      t948 = t385+t642+t801
      t949 = t387+t645+t802
      t402 = t398+1.0/2.0
      t403 = t399+1.0/2.0
      t404 = t398-1.0/2.0
      t405 = t399-1.0/2.0
      t427 = t426-1.0/2.0
      t478 = t301*t303*t312*t336
      t479 = t302*t304*t313*t338
      t480 = t43*t81*t250*t303*t312*t336*(-1.0/2.0)
      t481 = t45*t82*t250*t304*t313*t338*(-1.0/2.0)
      t482 = t303*t312*t314*t336
      t483 = t303*t312*t315*t336
      t484 = t304*t313*t316*t338
      t485 = t304*t313*t317*t338
      t488 = t304*t313*t319*t338
      t489 = t304*t313*t320*t338
      t501 = (iGvL1_3*sigma*sqrtGvL*t37*t73*t246*t339*t341*t348)/2.0
      t502 = (iGvL2_3*sigma*sqrtGvL*t37*t73*t246*t339*t341*t348)/2.0
      t503 = (iGvR1_3*sigma*sqrtGvR*t41*t74*t246*t339*t341*t348)/2.0
      t504 = (iGvR2_3*sigma*sqrtGvR*t41*t74*t246*t339*t341*t348)/2.0
      t505 = (sigma*t37*t85*t246*t339*t341*t348)/4.0
      t506 = (sigma*t41*t86*t246*t339*t341*t348)/4.0
      t578 = t378+t444
      t579 = t379+t445
      t596 = (Rd*sigma*t22*t58*t77*t103*t165*t179*t195*t224*t247*t339*t341*t348)/8.0
      t597 = (Rd*sigma*t19*t57*t75*t101*t165*t178*t194*t223*t247*t339*t341*t348)/8.0
      t651 = t303*t312*t336*t432
      t652 = t304*t313*t338*t433
      t653 = t303*t312*t336*t434
      t654 = t304*t313*t338*t435
      t655 = Rd*t19*t43*t57*t75*t79*t101*t178*t194*t223*t244*t251*t303*t312*t336*(-1.0/8.0)
      t656 = Rd*t19*t45*t57*t75*t80*t101*t178*t194*t223*t244*t251*t304*t313*t338*(-1.0/8.0)
      t657 = Rd*t22*t43*t58*t77*t79*t103*t179*t195*t224*t244*t251*t303*t312*t336*(-1.0/8.0)
      t658 = Rd*t22*t45*t58*t77*t80*t103*t179*t195*t224*t244*t251*t304*t313*t338*(-1.0/8.0)
      t786 = t304*t313*t338*t604
      t787 = t303*t312*t336*t605
      t788 = t45*t80*t223*t244*t251*t304*t313*t338*t460*(-1.0/8.0)
      t789 = t43*t79*t224*t244*t251*t303*t312*t336*t461*(-1.0/8.0)
      t803 = t304*t313*t338*t629
      t804 = t303*t312*t336*t630
      t805 = t45*t80*t223*t244*t251*t304*t313*t338*t464*(-1.0/8.0)
      t806 = (t43*t79*t224*t244*t251*t303*t312*t336*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0
      t815 = (t339*t341*t348*t624)/2.0
      t816 = (t339*t341*t348*t625)/2.0
      t825 = (t339*t341*t348*t646)/2.0
      t826 = (t339*t341*t348*t647)/2.0
      t829 = (t303*t312*t336*t692)/2.0
      t830 = (t304*t313*t338*t693)/2.0
      t840 = (t303*t312*t336*t696)/2.0
      t841 = (t304*t313*t338*t697)/2.0
      t466 = Kp*iGvL1_3*sigma*sqrtGvL*t37*t73*t138*t237*t248*t427
      t467 = Kp*iGvL2_3*sigma*sqrtGvL*t37*t73*t138*t237*t248*t427
      t468 = Kp*iGvR1_3*sigma*sqrtGvR*t41*t74*t138*t237*t248*t427
      t469 = Kp*iGvR2_3*sigma*sqrtGvR*t41*t74*t138*t237*t248*t427
      t470 = (Kp*sigma*t37*t85*t138*t237*t248*t427)/2.0
      t471 = (Kp*sigma*t41*t86*t138*t237*t248*t427)/2.0
      t472 = t357*t402
      t473 = t358*t403
      t474 = t359*t402
      t475 = t360*t402
      t476 = t361*t403
      t477 = t362*t403
      t486 = iGvL1_3*sqrtGvL*t480
      t487 = iGvL2_3*sqrtGvL*t480
      t490 = t374*t402
      t491 = t375*t403
      t496 = (t295*t324*t404)/4.0
      t497 = (t298*t321*t405)/4.0
      t499 = t390*t402
      t500 = t391*t403
      t507 = -t501
      t508 = -t502
      t509 = -t503
      t510 = -t504
      t511 = -t505
      t512 = -t506
      t549 = Kp*Rd*t6*t19*t25*t101*t138*t178*t194*t246*t339*t427
      t550 = Kp*Rd*t7*t22*t26*t103*t138*t179*t195*t246*t339*t427
      t554 = beta*t254*t289*t295*t404*2.0
      t555 = beta*t255*t282*t298*t405*2.0
      t557 = Kp*t138*t237*t246*t339*t427
      t558 = beta*t256*t289*t295*t404*2.0
      t559 = beta*t257*t289*t295*t404*2.0
      t560 = beta*t258*t282*t298*t405*2.0
      t561 = beta*t259*t282*t298*t405*2.0
      t564 = t262*t281*t324*t404
      t565 = t263*t290*t321*t405
      t566 = t254*t281*t324*t404*(-1.0/2.0)
      t569 = t268*t281*t324*t404
      t570 = t269*t281*t324*t404
      t571 = t270*t290*t321*t405
      t572 = t271*t290*t321*t405
      t573 = (Kp*t25*t139*t237*t246*t339*t427)/2.0
      t574 = (Kp*t26*t139*t237*t246*t339*t427)/2.0
      t575 = t256*t281*t324*t404*(-1.0/2.0)
      t576 = t257*t281*t324*t404*(-1.0/2.0)
      t594 = (Kp*Rd*sigma*t19*t57*t75*t101*t138*t165*t178*t194*t223*t237*t249*t427)/4.0
      t595 = (Kp*Rd*sigma*t22*t58*t77*t103*t138*t165*t179*t195*t224*t237*t249*t427)/4.0
      t598 = -t596
      t599 = -t597
      t648 = (t298*t405*t428)/4.0
      t649 = (t295*t404*t429)/4.0
      t659 = t392+t480
      t660 = t393+t481
      t663 = t396+t488
      t664 = t397+t489
      t665 = (Kp*Rd*t19*t57*t75*t101*t138*t178*t194*t223*t237*t247*t339*t427)/2.0
      t666 = (Kp*Rd*t22*t58*t77*t103*t138*t179*t195*t224*t237*t247*t339*t427)/2.0
      t667 = (Rd*beta*t19*t57*t75*t95*t101*t178*t194*t223*t246*t289*t295*t404)/2.0
      t668 = (Rd*beta*t19*t57*t75*t96*t101*t178*t194*t223*t246*t282*t298*t405)/2.0
      t669 = (Rd*beta*t22*t58*t77*t95*t103*t179*t195*t224*t246*t289*t295*t404)/2.0
      t670 = (Rd*beta*t22*t58*t77*t96*t103*t179*t195*t224*t246*t282*t298*t405)/2.0
      t673 = t281*t324*t404*t411
      t674 = t290*t321*t405*t413
      t675 = t281*t324*t404*t415
      t676 = t290*t321*t405*t417
      t677 = Rd*t19*t57*t75*t95*t101*t178*t194*t223*t246*t281*t324*t404*(-1.0/8.0)
      t678 = Rd*t22*t58*t77*t95*t103*t179*t195*t224*t246*t281*t324*t404*(-1.0/8.0)
      t679 = -Kp*p0*t138*t246*t339*t427*(t238-t342)
      t680 = -Kp*p0*t138*t246*t339*t427*(t239-t343)
      t681 = Kp*p0*t138*t246*t339*t427*(t238-t342)
      t682 = Kp*p0*t138*t246*t339*t427*(t239-t343)
      t683 = -Kp*p0*t138*t246*t339*t427*(t276-t344)
      t684 = -Kp*p0*t138*t246*t339*t427*(t277-t345)
      t685 = Kp*p0*t138*t246*t339*t427*(t276-t344)
      t702 = t263*t290*t405*t428
      t703 = t262*t281*t404*t429
      t704 = t270*t290*t405*t428
      t705 = t271*t290*t405*t428
      t706 = t268*t281*t404*t429
      t707 = t269*t281*t404*t429
      t708 = t402*t567
      t709 = t403*t568
      t711 = t402*t578
      t712 = t402*t579
      t713 = t403*t580
      t714 = t403*t581
      t719 = t402*t590
      t720 = t402*t591
      t721 = t403*t592
      t722 = t403*t593
      t739 = (t298*t405*t531)/4.0
      t740 = (t295*t404*t532)/4.0
      t742 = (t298*t405*t533)/4.0
      t743 = (t298*t405*t534)/4.0
      t744 = (t295*t404*t535)/4.0
      t745 = (t295*t404*t536)/4.0
      t754 = t290*t405*t413*t428
      t755 = t290*t405*t417*t428
      t758 = t281*t404*t411*t429
      t759 = t281*t404*t415*t429
      t790 = (Kp*t138*t223*t237*t247*t339*t427*t460)/2.0
      t791 = (Kp*t138*t224*t237*t247*t339*t427*t461)/2.0
      t793 = (beta*t95*t224*t246*t289*t295*t404*t461)/2.0
      t794 = (beta*t96*t223*t246*t282*t298*t405*t460)/2.0
      t795 = t290*t321*t405*t520
      t796 = t281*t324*t404*t522
      t807 = (Kp*t138*t223*t237*t247*t339*t427*t464)/2.0
      t808 = Kp*t138*t224*t237*t247*t339*t427*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)*(-1.0/2.0)
      t809 = (beta*t96*t223*t246*t282*t298*t405*t464)/2.0
      t810 = beta*t95*t224*t246*t289*t295*t404*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)*(-1.0/2.0)
      t811 = (beta*t95*t224*t246*t289*t295*t404*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/2.0
      t812 = t290*t321*t405*t544
      t813 = t281*t324*t404*t546
      t814 = (t95*t224*t246*t281*t324*t404*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0
      t817 = -t815
      t818 = -t816
      t827 = -t825
      t828 = -t826
      t831 = -t829
      t832 = -t830
      t833 = Kp*t138*t237*t246*t427*t624
      t834 = Kp*t138*t237*t246*t427*t625
      t836 = beta*t289*t295*t404*t612*2.0
      t837 = beta*t282*t298*t405*t613*2.0
      t838 = (t281*t324*t404*t612)/2.0
      t839 = (t290*t321*t405*t613)/2.0
      t842 = -t840
      t843 = -t841
      t844 = Kp*t138*t237*t246*t427*t646
      t845 = Kp*t138*t237*t246*t427*t647
      t846 = beta*t289*t295*t404*t634*2.0
      t847 = beta*t282*t298*t405*t635*2.0
      t849 = (t281*t324*t404*t634)/2.0
      t850 = (t290*t321*t405*t635)/2.0
      t858 = t492+t655
      t859 = t493+t656
      t860 = t494+t657
      t861 = t495+t658
      t864 = t402*t776
      t865 = t403*t777
      t866 = t402*t778
      t867 = t403*t779
      t874 = t290*t405*t428*t520
      t875 = t281*t404*t429*t522
      t876 = t290*t405*t428*t544
      t877 = t281*t404*t429*t546
      t878 = (t298*t405*t780)/4.0
      t879 = (t298*t405*t781)/4.0
      t880 = (t295*t404*t782)/4.0
      t882 = (t295*t404*t783)/4.0
      t886 = (t290*t405*t428*t613)/2.0
      t887 = (t281*t404*t429*t612)/2.0
      t888 = (t290*t405*t428*t635)/2.0
      t889 = (t281*t404*t429*t634)/2.0
      t908 = t402*t870
      t909 = t403*t871
      t913 = -t402*((t95*t224*t246*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0+(t43*t79*t224*t244*t251*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0)
      t914 = t403*t873
      t923 = t402*t906
      t924 = t403*t907
      t926 = t402*t911
      t927 = t403*t912
      t928 = t695+t788
      t929 = t694+t789
      t930 = t403*t915
      t931 = t402*t916
      t933 = t698+t805
      t934 = t699+t806
      t935 = t403*t917
      t936 = -t402*(t734+(t95*t224*t246*t328*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0)
      t937 = t402*(t734+(t95*t224*t246*t328*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0)
      t960 = -t374*(t804+(t43*t79*t224*t244*t251*t335*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0)
      t963 = t295*t324*(t804+(t43*t79*t224*t244*t251*t335*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0)*(-1.0/4.0)
      t964 = (t295*t324*(t804+(t43*t79*t224*t244*t251*t335*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0))/4.0
      t967 = -t390*(t804+(t43*t79*t224*t244*t251*t335*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0)
      t969 = t390*(t804+(t43*t79*t224*t244*t251*t335*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0)
      t970 = t402*t944
      t971 = t403*t945
      t976 = t402*t948
      t977 = -t403*(t389+t800+(t96*t224*t246*t330*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0)
      t981 = (t298*t405*t940)/4.0
      t983 = (t295*t404*t941)/4.0
      t995 = t295*t429*(t804+(t43*t79*t224*t244*t251*t335*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0)*(-1.0/4.0)
      t996 = (t298*t405*t946)/4.0
      t997 = t295*t404*(t539+alpha*t95*t224*t246*t297*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)+alpha*t105*t224*t247*t289*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)*2.0)*(-1.0/4.0)
      t1047 = (t298*t405*t1007)/4.0
      t1049 = (t295*t404*t1008)/4.0
      t1050 = (t298*t405*t1033)/4.0
      t1052 = (t295*t404*t1034)/4.0
      t498 = -t496
      t551 = -t549
      t556 = -t554
      t562 = -t558
      t563 = -t559
      t577 = -t573
      t650 = -t649
      t661 = t394+t486
      t662 = t395+t487
      t671 = -t667
      t672 = -t669
      t686 = t418+t507
      t687 = t419+t508
      t688 = t420+t509
      t689 = t421+t510
      t690 = t422+t511
      t691 = t423+t512
      t710 = -t708
      t715 = -t711
      t716 = -t712
      t741 = -t739
      t746 = -t742
      t747 = -t743
      t748 = t374*t659
      t749 = t375*t660
      t752 = t375*t663
      t753 = t375*t664
      t756 = (t295*t324*t659)/4.0
      t757 = (t298*t321*t660)/4.0
      t763 = (t298*t321*t663)/4.0
      t764 = (t298*t321*t664)/4.0
      t767 = t390*t659
      t768 = t391*t660
      t772 = t391*t663
      t773 = t391*t664
      t792 = -t791
      t797 = t462+t599
      t798 = t463+t598
      t835 = -t833
      t848 = -t846
      t851 = -t849
      t852 = (t298*t428*t660)/4.0
      t853 = (t295*t429*t659)/4.0
      t854 = (t298*t428*t663)/4.0
      t855 = (t298*t428*t664)/4.0
      t862 = t500+t648
      t868 = -t864
      t869 = -t866
      t881 = -t878
      t883 = -t879
      t890 = t374*t858
      t891 = t374*t860
      t892 = t375*t859
      t893 = t375*t861
      t894 = (t295*t324*t858)/4.0
      t895 = (t298*t321*t859)/4.0
      t896 = (t295*t324*t860)/4.0
      t897 = (t298*t321*t861)/4.0
      t900 = t390*t858
      t901 = t390*t860
      t902 = t391*t859
      t903 = t391*t861
      t910 = -t908
      t919 = (t298*t428*t859)/4.0
      t920 = (t298*t428*t861)/4.0
      t921 = (t295*t429*t858)/4.0
      t922 = (t295*t429*t860)/4.0
      t925 = -t923
      t932 = -t931
      t938 = t700+t817
      t939 = t701+t818
      t942 = t717+t827
      t943 = t718+t828
      t950 = t374*t929
      t951 = t375*t928
      t953 = (t298*t321*t928)/4.0
      t954 = (t295*t324*t929)/4.0
      t955 = t729+t831
      t956 = t730+t832
      t957 = t390*t929
      t958 = t391*t928
      t961 = t375*t933
      t962 = (t298*t321*t933)/4.0
      t965 = t737+t842
      t966 = t738+t843
      t968 = t391*t933
      t972 = -t971
      t978 = -t976
      t982 = -t981
      t984 = (t298*t428*t928)/4.0
      t985 = (t295*t429*t929)/4.0
      t994 = (t298*t428*t933)/4.0
      t999 = -t996
      t1048 = -t1047
      t1051 = -t1050
      t1113 = t877+t937+t969+t995+t997
      t750 = t374*t661
      t751 = t374*t662
      t760 = -t756
      t761 = (t295*t324*t661)/4.0
      t762 = (t295*t324*t662)/4.0
      t769 = -t767
      t770 = t390*t661
      t771 = t390*t662
      t819 = Kp*t138*t237*t246*t339*t686
      t820 = Kp*t138*t237*t246*t339*t687
      t821 = Kp*t138*t237*t246*t339*t688
      t822 = Kp*t138*t237*t246*t339*t689
      t823 = Kp*t138*t237*t246*t339*t690
      t824 = Kp*t138*t237*t246*t339*t691
      t856 = (t295*t429*t661)/4.0
      t857 = (t295*t429*t662)/4.0
      t863 = t499+t650
      t884 = Kp*t138*t237*t246*t339*t797
      t885 = Kp*t138*t237*t246*t339*t798
      t898 = -t894
      t899 = -t896
      t904 = -t900
      t905 = -t901
      t952 = -t950
      t959 = -t957
      t973 = Kp*t138*t237*t246*t339*t938
      t974 = Kp*t138*t237*t246*t339*t939
      t979 = Kp*t138*t237*t246*t339*t942
      t980 = Kp*t138*t237*t246*t339*t943
      t986 = t374*t955
      t987 = t375*t956
      t989 = (t295*t324*t955)/4.0
      t990 = (t298*t321*t956)/4.0
      t991 = t390*t955
      t992 = t391*t956
      t998 = t374*t965
      t1000 = t375*t966
      t1001 = (t295*t324*t965)/4.0
      t1002 = (t298*t321*t966)/4.0
      t1004 = t390*t965
      t1005 = t391*t966
      t1009 = t490+t491+t497+t498+t557
      t1016 = (t298*t428*t956)/4.0
      t1017 = (t295*t429*t955)/4.0
      t1035 = (t298*t428*t966)/4.0
      t1036 = (t295*t429*t965)/4.0
      t1060 = t702+t709+t741+t768+t852
      t1062 = t704+t713+t746+t772+t854
      t1063 = t705+t714+t747+t773+t855
      t1100 = t754+t865+t881+t902+t919
      t1101 = t755+t867+t883+t903+t920
      t1110 = t874+t930+t958+t982+t984
      t1112 = t876+t935+t968+t994+t999
      t765 = -t761
      t766 = -t762
      t774 = -t770
      t775 = -t771
      t975 = -t973
      t988 = -t986
      t993 = -t991
      t1003 = -t1001
      t1006 = -t1004
      t1010 = Ku*t37*t71*t73*t242*t862*t863
      t1011 = Ku*t37*t72*t73*t242*t862*t863
      t1012 = Ku*t41*t71*t74*t242*t862*t863
      t1013 = Ku*t41*t72*t74*t242*t862*t863
      t1018 = Ku*t37*t73*t97*t242*t862*t863
      t1019 = Ku*t41*t74*t97*t242*t862*t863
      t1021 = Ku*iGL1_3*t164*t242*t862*t863
      t1022 = Ku*iGL2_3*t164*t242*t862*t863
      t1023 = Ku*iGR1_3*t164*t242*t862*t863
      t1024 = Ku*iGR2_3*t164*t242*t862*t863
      t1029 = Ku*sqrtGhL*t25*t164*t242*t862*t863
      t1030 = Ku*sqrtGhR*t26*t164*t242*t862*t863
      t1037 = t252*t1009
      t1043 = (Rd*t19*t27*t57*t75*t101*t178*t194*t223*t1009)/4.0
      t1044 = (Rd*t22*t28*t58*t77*t103*t179*t195*t224*t1009)/4.0
      t1053 = (t27*t223*t460*t1009)/4.0
      t1054 = (t28*t224*t461*t1009)/4.0
      t1056 = (t27*t223*t464*t1009)/4.0
      t1057 = t28*t224*t1009*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)*(-1.0/4.0)
      t1059 = (t28*t224*t1009*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/4.0
      t1061 = t703+t710+t740+t769+t853
      t1066 = t471+t473+t555+t565+t749+t757+t824
      t1067 = t470+t472+t556+t566+t748+t760+t823
      t1068 = t468+t476+t560+t571+t752+t763+t821
      t1069 = t469+t477+t561+t572+t753+t764+t822
      t1102 = t758+t868+t880+t904+t921
      t1103 = t759+t869+t882+t905+t922
      t1111 = t875+t932+t959+t983+t985
      t1120 = t886+t972+t992+t1016+t1048
      t1122 = t888+t977+t1005+t1035+t1051
      t1136 = t550+t595+t666+t670+t672+t676+t678+t720+t722+t885+t891+t893+t897+t899
      t1137 = t551+t594+t665+t668+t671+t674+t677+t719+t721+t884+t890+t892+t895+t898
      t1152 = t574+t682+t792+t793+t796+t834+t837+t839+t910+t924+t952+t954+t974+t987+t990
      t1156 = t574+t684+t808+t811+t814+t845+t847+t850+t913+t927+t960+t964+t980+t1000+t1002
      t1014 = -t1012
      t1015 = -t1013
      t1020 = -t1019
      t1025 = -t1021
      t1026 = -t1022
      t1027 = -t1023
      t1028 = -t1024
      t1031 = -t1029
      t1032 = -t1030
      t1038 = abs(t1037)
      t1039 = merge( 0._r_kind, sign(1._r_kind,t1037), t1037==0 )!(t1037/abs(t1037))
      t1045 = -t1043
      t1046 = -t1044
      t1055 = -t1053
      t1058 = -t1056
      t1064 = t706+t715+t744+t774+t856
      t1065 = t707+t716+t745+t775+t857
      t1070 = t466+t474+t562+t575+t750+t765+t819
      t1071 = t467+t475+t563+t576+t751+t766+t820
      t1121 = t887+t970+t993+t1017+t1049
      t1123 = t889+t978+t1006+t1036+t1052
      t1138 = t252*t1136
      t1139 = t252*t1137
      t1153 = t577+t681+t790+t794+t795+t835+t836+t838+t909+t925+t951+t953+t975+t988+t989
      t1154 = t252*t1152
      t1157 = t573+t685+t807+t809+t812+t844+t848+t851+t914+t926+t961+t962+t979+t998+t1003
      t1158 = t252*t1156
      t1040 = t1038+1.0E-15
      t1144 = t1046+t1138
      t1145 = t1045+t1139
      t1155 = t252*t1153
      t1159 = t252*t1157
      t1165 = t1054+t1154
      t1171 = t1059+t1158
      t1041 = 1.0/t1040
      t1166 = t1055+t1155
      t1172 = t1058+t1159
      t1042 = t1041*t1041
      t1072 = (t1037*t1041)/2.0
      t1094 = (Rd*t19*t27*t57*t75*t101*t178*t194*t223*t1009*t1041)/8.0
      t1095 = (Rd*t22*t28*t58*t77*t103*t179*t195*t224*t1009*t1041)/8.0
      t1096 = (t27*t223*t460*t1009*t1041)/8.0
      t1097 = (t28*t224*t461*t1009*t1041)/8.0
      t1098 = (t27*t223*t464*t1009*t1041)/8.0
      t1099 = t28*t224*t1009*t1041*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)*(-1.0/8.0)
      t1104 = (t252*t1041*t1066)/2.0
      t1105 = (t252*t1041*t1067)/2.0
      t1106 = (t252*t1041*t1068)/2.0
      t1107 = (t252*t1041*t1069)/2.0
      t1108 = (t252*t1041*t1070)/2.0
      t1109 = (t252*t1041*t1071)/2.0
      t1140 = (t1041*t1138)/2.0
      t1142 = (t1041*t1139)/2.0
      t1162 = (t1041*t1154)/2.0
      t1163 = (t1041*t1155)/2.0
      t1167 = (t1041*t1158)/2.0
      t1169 = (t1041*t1159)/2.0
      t1073 = -t1072
      t1074 = t1072+1.0/2.0
      t1075 = t1072-1.0/2.0
      t1124 = (t253*t1009*t1039*t1042*t1066)/2.0
      t1125 = (t253*t1009*t1039*t1042*t1067)/2.0
      t1128 = (t253*t1009*t1039*t1042*t1068)/2.0
      t1129 = (t253*t1009*t1039*t1042*t1069)/2.0
      t1130 = (t253*t1009*t1039*t1042*t1070)/2.0
      t1131 = (t253*t1009*t1039*t1042*t1071)/2.0
      t1141 = -t1140
      t1143 = -t1142
      t1160 = t1037*t1039*t1042*(t1044-t1138)*(-1.0/2.0)
      t1161 = t1037*t1039*t1042*(t1043-t1139)*(-1.0/2.0)
      t1164 = -t1163
      t1168 = -t1167
      t1170 = -t1169
      t1173 = (t1037*t1039*t1042*t1165)/2.0
      t1175 = t1037*t1039*t1042*(t1053-t1155)*(-1.0/2.0)
      t1176 = (t1037*t1039*t1042*t1171)/2.0
      t1177 = t1037*t1039*t1042*(t1056-t1159)*(-1.0/2.0)
      t1076 = qL1*t1074
      t1077 = qL2*t1074
      t1078 = qL3*t1074
      t1079 = qL4*t1074
      t1080 = qL5*t1074
      t1081 = qL6*t1074
      t1082 = qR1*t1075
      t1083 = qR2*t1075
      t1084 = qR3*t1075
      t1085 = qR4*t1075
      t1086 = qR5*t1075
      t1087 = qR6*t1075
      t1126 = -t1124
      t1127 = -t1125
      t1132 = -t1128
      t1133 = -t1129
      t1134 = -t1130
      t1135 = -t1131
      t1174 = -t1173
      t1178 = t1095+t1141+t1160
      t1179 = t1094+t1143+t1161
      t1181 = t1096+t1164+t1175
      t1182 = t1099+t1168+t1176
      t1183 = t1098+t1170+t1177
      t1088 = -t1082
      t1089 = -t1083
      t1090 = -t1084
      t1091 = -t1085
      t1092 = -t1086
      t1093 = -t1087
      t1146 = t1104+t1126
      t1147 = t1105+t1127
      t1148 = t1106+t1132
      t1149 = t1107+t1133
      t1150 = t1108+t1134
      t1151 = t1109+t1135
      t1180 = t1097+t1162+t1174
      t1114 = t1076+t1088
      t1115 = t1077+t1089
      t1116 = t1078+t1090
      t1117 = t1079+t1091
      t1118 = t1080+t1092
      t1119 = t1081+t1093
      
      dFdqL(1,1) = t1056*t1114-t1114*t1159+t1037*(t1074-qL1*(-t1098+t1169+(t1037*t1039*t1042*(t1056-t1159))/2.0)+qR1*(-t1098+t1169+(t1037*t1039*t1042*(t1056-t1159))/2.0))
      dFdqL(1,2) = t1037*(qL1*t1150-qR1*t1150)+t252*t1070*t1114
      dFdqL(1,3) = t1037*(qL1*t1151-qR1*t1151)+t252*t1071*t1114
      dFdqL(1,4) = t1037*(qL1*t1147-qR1*t1147)+t252*t1067*t1114
      dFdqL(1,5) = t1043*t1114-t1114*t1139-t1037*(qL1*(-t1094+t1142+(t1037*t1039*t1042*(t1043-t1139))/2.0)-qR1*(-t1094+t1142+(t1037*t1039*t1042*(t1043-t1139))/2.0))
      dFdqL(1,6) = t1114*t1155+t1037*(qL1*(-t1096+t1163+(t1037*t1039*t1042*(t1053-t1155))/2.0)-qR1*(-t1096+t1163+(t1037*t1039*t1042*(t1053-t1155))/2.0))-(t27*t223*t460*t1009*t1114)/4.0
      dFdqL(2,1) = t1010+t1025+t1056*t1115-t1115*t1159-t1037*(qL2*(-t1098+t1169+(t1037*t1039*t1042*(t1056-t1159))/2.0)-qR2*(-t1098+t1169+(t1037*t1039*t1042*(t1056-t1159))/2.0))+iGL1_3*sqrtGL*t192*t1123-iGR1_3*sqrtGR*t196*t1112-iGL1_3*p0*sqrtGL*t863*(t276-t344)+Ku*t71*t164*t242*t863*t1112-Ku*t71*t164*t242*t862*t1123-(Ku*t71*t164*t223*t464*t862*t863)/4.0
      dFdqL(2,2) = t1037*(t1074+qL2*t1150-qR2*t1150)+t252*t1070*t1115-iGL1_3*sqrtGL*t192*t1064+Ku*t71*t164*t242*t862*t1064-Ku*iGvL1_3*sqrtGvL*t36*t71*t242*t862*t863
      dFdqL(2,3) = t1037*(qL2*t1151-qR2*t1151)+t252*t1071*t1115-iGL1_3*sqrtGL*t192*t1065+Ku*t71*t164*t242*t862*t1065-Ku*iGvL2_3*sqrtGvL*t36*t71*t242*t862*t863
      dFdqL(2,4) = t1037*(qL2*t1147-qR2*t1147)+t252*t1067*t1115-iGL1_3*sqrtGL*t192*t1061-Ku*t36*t71*t242*t862*t863+Ku*t71*t164*t242*t862*t1061
      dFdqL(2,5) = t1043*t1115-t1115*t1139-t1037*(qL2*(-t1094+t1142+(t1037*t1039*t1042*(t1043-t1139))/2.0)-qR2*(-t1094+t1142+(t1037*t1039*t1042*(t1043-t1139))/2.0))+iGL1_3*sqrtGL*t192*t1102+iGR1_3*sqrtGR*t193*t1100+Ku*t71*t164*t242*t863*t1100-Ku*t71*t164*t242*t862*t1102+Rd*t19*t29*t101*t178*t194*t863-(Ku*Rd*t19*t57*t71*t75*t101*t164*t178*t194*t223*t862*t863)/4.0
      dFdqL(2,6) = t1010+t1025+t1115*t1155+t1037*(qL2*(-t1096+t1163+(t1037*t1039*t1042*(t1053-t1155))/2.0)-qR2*(-t1096+t1163+(t1037*t1039*t1042*(t1053-t1155))/2.0))+iGL1_3*sqrtGL*t192*t1121+iGR1_3*sqrtGR*t196*t1110-(t27*t223*t460*t1009*t1115)/4.0+iGL1_3*p0*sqrtGL*t863*(t238-t342)-Ku*t71*t164*t242*t863*t1110-Ku*t71*t164*t242*t862*t1121+(Ku*t71*t164*t223*t460*t862*t863)/4.0
      dFdqL(3,1) = t1011+t1026+t1056*t1116-t1116*t1159-t1037*(qL3*(-t1098+t1169+(t1037*t1039*t1042*(t1056-t1159))/2.0)-qR3*(-t1098+t1169+(t1037*t1039*t1042*(t1056-t1159))/2.0))+iGL2_3*sqrtGL*t192*t1123-iGR2_3*sqrtGR*t196*t1112-iGL2_3*p0*sqrtGL*t863*(t276-t344)+Ku*t72*t164*t242*t863*t1112-Ku*t72*t164*t242*t862*t1123-(Ku*t72*t164*t223*t464*t862*t863)/4.0
      dFdqL(3,2) = t1037*(qL3*t1150-qR3*t1150)+t252*t1070*t1116-iGL2_3*sqrtGL*t192*t1064+Ku*t72*t164*t242*t862*t1064-Ku*iGvL1_3*sqrtGvL*t36*t72*t242*t862*t863
      dFdqL(3,3) = t1037*(t1074+qL3*t1151-qR3*t1151)+t252*t1071*t1116-iGL2_3*sqrtGL*t192*t1065+Ku*t72*t164*t242*t862*t1065-Ku*iGvL2_3*sqrtGvL*t36*t72*t242*t862*t863
      dFdqL(3,4) = t1037*(qL3*t1147-qR3*t1147)+t252*t1067*t1116-iGL2_3*sqrtGL*t192*t1061-Ku*t36*t72*t242*t862*t863+Ku*t72*t164*t242*t862*t1061
      dFdqL(3,5) = t1043*t1116-t1116*t1139-t1037*(qL3*(-t1094+t1142+(t1037*t1039*t1042*(t1043-t1139))/2.0)-qR3*(-t1094+t1142+(t1037*t1039*t1042*(t1043-t1139))/2.0))+iGL2_3*sqrtGL*t192*t1102+iGR2_3*sqrtGR*t193*t1100+Ku*t72*t164*t242*t863*t1100-Ku*t72*t164*t242*t862*t1102+Rd*t19*t30*t101*t178*t194*t863-(Ku*Rd*t19*t57*t72*t75*t101*t164*t178*t194*t223*t862*t863)/4.0
      dFdqL(3,6) = t1011+t1026+t1116*t1155+t1037*(qL3*(-t1096+t1163+(t1037*t1039*t1042*(t1053-t1155))/2.0)-qR3*(-t1096+t1163+(t1037*t1039*t1042*(t1053-t1155))/2.0))+iGL2_3*sqrtGL*t192*t1121+iGR2_3*sqrtGR*t196*t1110-(t27*t223*t460*t1009*t1116)/4.0+iGL2_3*p0*sqrtGL*t863*(t238-t342)-Ku*t72*t164*t242*t863*t1110-Ku*t72*t164*t242*t862*t1121+(Ku*t72*t164*t223*t460*t862*t863)/4.0
      dFdqL(4,1) = t1018+t1031+t1056*t1117-t1117*t1159-t1037*(qL4*(-t1098+t1169+(t1037*t1039*t1042*(t1056-t1159))/2.0)-qR4*(-t1098+t1169+(t1037*t1039*t1042*(t1056-t1159))/2.0))-sqrtGhR*t196*t1112+sqrtGhL*t192*t1123-p0*sqrtGhL*t863*(t276-t344)+Ku*t97*t164*t242*t863*t1112-Ku*t97*t164*t242*t862*t1123-(Ku*t97*t164*t223*t464*t862*t863)/4.0
      dFdqL(4,2) = t1037*(qL4*t1150-qR4*t1150)-sqrtGhL*t192*t1064+t252*t1070*t1117+Ku*t97*t164*t242*t862*t1064-Ku*iGvL1_3*sqrtGvL*t36*t97*t242*t862*t863
      dFdqL(4,3) = t1037*(qL4*t1151-qR4*t1151)-sqrtGhL*t192*t1065+t252*t1071*t1117+Ku*t97*t164*t242*t862*t1065-Ku*iGvL2_3*sqrtGvL*t36*t97*t242*t862*t863
      dFdqL(4,4) = t1037*(t1074+qL4*t1147-qR4*t1147)-sqrtGhL*t192*t1061+t252*t1067*t1117-Ku*t36*t97*t242*t862*t863+Ku*t97*t164*t242*t862*t1061
      dFdqL(4,5) = t1043*t1117-t1117*t1139-t1037*(qL4*(-t1094+t1142+(t1037*t1039*t1042*(t1043-t1139))/2.0)-qR4*(-t1094+t1142+(t1037*t1039*t1042*(t1043-t1139))/2.0))+sqrtGhL*t192*t1102+sqrtGhR*t193*t1100+Ku*t97*t164*t242*t863*t1100-Ku*t97*t164*t242*t862*t1102+Rd*t19*t61*t101*t178*t194*t863-(Ku*Rd*t19*t57*t75*t97*t101*t164*t178*t194*t223*t862*t863)/4.0
      dFdqL(4,6) = t1018+t1031+t1117*t1155+t1037*(qL4*(-t1096+t1163+(t1037*t1039*t1042*(t1053-t1155))/2.0)-qR4*(-t1096+t1163+(t1037*t1039*t1042*(t1053-t1155))/2.0))+sqrtGhR*t196*t1110+sqrtGhL*t192*t1121+p0*sqrtGhL*t863*(t238-t342)-(t27*t223*t460*t1009*t1117)/4.0-Ku*t97*t164*t242*t863*t1110-Ku*t97*t164*t242*t862*t1121+(Ku*t97*t164*t223*t460*t862*t863)/4.0
      dFdqL(5,1) = t1056*t1118-t1118*t1159-t1037*(qL5*(-t1098+t1169+(t1037*t1039*t1042*(t1056-t1159))/2.0)-qR5*(-t1098+t1169+(t1037*t1039*t1042*(t1056-t1159))/2.0))
      dFdqL(5,2) = t1037*(qL5*t1150-qR5*t1150)+t252*t1070*t1118
      dFdqL(5,3) = t1037*(qL5*t1151-qR5*t1151)+t252*t1071*t1118
      dFdqL(5,4) = t1037*(qL5*t1147-qR5*t1147)+t252*t1067*t1118
      dFdqL(5,5) = t1043*t1118-t1118*t1139+t1037*(t1074-qL5*(-t1094+t1142+(t1037*t1039*t1042*(t1043-t1139))/2.0)+qR5*(-t1094+t1142+(t1037*t1039*t1042*(t1043-t1139))/2.0))
      dFdqL(5,6) = t1118*t1155+t1037*(qL5*(-t1096+t1163+(t1037*t1039*t1042*(t1053-t1155))/2.0)-qR5*(-t1096+t1163+(t1037*t1039*t1042*(t1053-t1155))/2.0))-(t27*t223*t460*t1009*t1118)/4.0
      dFdqL(6,1) = t1056*t1119-t1119*t1159-t1037*(qL6*(-t1098+t1169+(t1037*t1039*t1042*(t1056-t1159))/2.0)-qR6*(-t1098+t1169+(t1037*t1039*t1042*(t1056-t1159))/2.0))
      dFdqL(6,2) = t1037*(qL6*t1150-qR6*t1150)+t252*t1070*t1119
      dFdqL(6,3) = t1037*(qL6*t1151-qR6*t1151)+t252*t1071*t1119
      dFdqL(6,4) = t1037*(qL6*t1147-qR6*t1147)+t252*t1067*t1119
      dFdqL(6,5) = t1043*t1119-t1119*t1139-t1037*(qL6*(-t1094+t1142+(t1037*t1039*t1042*(t1043-t1139))/2.0)-qR6*(-t1094+t1142+(t1037*t1039*t1042*(t1043-t1139))/2.0))
      dFdqL(6,6) = t1119*t1155+t1037*(t1074+qL6*(-t1096+t1163+(t1037*t1039*t1042*(t1053-t1155))/2.0)-qR6*(-t1096+t1163+(t1037*t1039*t1042*(t1053-t1155))/2.0))-(t27*t223*t460*t1009*t1119)/4.0
      dFdqR(1,1) = -t1037*(t1075+qL1*(t1167-t1176+(t28*t224*t1009*t1041*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0)-qR1*(t1167-t1176+(t28*t224*t1009*t1041*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0))+t1057*t1114-t1114*t1158
      dFdqR(1,2) = t1037*(qL1*t1148-qR1*t1148)+t252*t1068*t1114
      dFdqR(1,3) = t1037*(qL1*t1149-qR1*t1149)+t252*t1069*t1114
      dFdqR(1,4) = t1037*(qL1*t1146-qR1*t1146)+t252*t1066*t1114
      dFdqR(1,5) = t1044*t1114-t1114*t1138-t1037*(qL1*(-t1095+t1140+(t1037*t1039*t1042*(t1044-t1138))/2.0)-qR1*(-t1095+t1140+(t1037*t1039*t1042*(t1044-t1138))/2.0))
      dFdqR(1,6) = -t1114*t1154-t1037*(qL1*t1180-qR1*t1180)-(t28*t224*t461*t1009*t1114)/4.0
      dFdqR(2,1) = t1014+t1027+t1057*t1115-t1115*t1158-t1037*(qL2*(t1167-t1176+(t28*t224*t1009*t1041*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0)-qR2*(t1167-t1176+(t28*t224*t1009*t1041*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0))+iGR1_3*sqrtGR*t193*t1122-iGL1_3*sqrtGL*t192*(t936+t967+(t295*t404*(t539+alpha*t95*t224*t246*t297*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)+alpha*t105*t224*t247*t289*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)*2.0))/4.0+(t295*t429*(t804+(t43*t79*t224*t244*t251*t335*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0))/4.0+(t95*t224*t246*t281*t404*t429*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0)+iGR1_3*p0*sqrtGR*t862*(t277-t345)+Ku*t71*t164*t242*t862*(t936+t967+(t295*t404*(t539+alpha*t95*t224*t246*t297*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)+alpha*t105*t224*t247*t289*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)*2.0))/4.0+(t295*t429*(t804+(t43*t79*t224*t244*t251*t335*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0))/4.0+(t95*t224*t246*t281*t404*t429*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0)+Ku*t71*t164*t242*t863*t1122+(Ku*t71*t164*t224*t862*t863*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/4.0
      dFdqR(2,2) = -t1037*(t1075-qL2*t1148+qR2*t1148)+t252*t1068*t1115+iGR1_3*sqrtGR*t196*t1062-Ku*t71*t164*t242*t863*t1062+Ku*iGvR1_3*sqrtGvR*t40*t71*t242*t862*t863
      dFdqR(2,3) = t1037*(qL2*t1149-qR2*t1149)+t252*t1069*t1115+iGR1_3*sqrtGR*t196*t1063-Ku*t71*t164*t242*t863*t1063+Ku*iGvR2_3*sqrtGvR*t40*t71*t242*t862*t863
      dFdqR(2,4) = t1037*(qL2*t1146-qR2*t1146)+t252*t1066*t1115+iGR1_3*sqrtGR*t196*t1060+Ku*t40*t71*t242*t862*t863-Ku*t71*t164*t242*t863*t1060
      dFdqR(2,5) = t1044*t1115-t1115*t1138-t1037*(qL2*(-t1095+t1140+(t1037*t1039*t1042*(t1044-t1138))/2.0)-qR2*(-t1095+t1140+(t1037*t1039*t1042*(t1044-t1138))/2.0))+iGL1_3*sqrtGL*t192*t1103+iGR1_3*sqrtGR*t193*t1101+Ku*t71*t164*t242*t863*t1101-Ku*t71*t164*t242*t862*t1103-Rd*t22*t31*t103*t179*t195*t862-(Ku*Rd*t22*t58*t71*t77*t103*t164*t179*t195*t224*t862*t863)/4.0
      dFdqR(2,6) = t1014+t1027-t1115*t1154-t1037*(qL2*t1180-qR2*t1180)-iGL1_3*sqrtGL*t192*t1111+iGR1_3*sqrtGR*t193*t1120-(t28*t224*t461*t1009*t1115)/4.0-iGR1_3*p0*sqrtGR*t862*(t239-t343)+Ku*t71*t164*t242*t862*t1111+Ku*t71*t164*t242*t863*t1120+(Ku*t71*t164*t224*t461*t862*t863)/4.0
      dFdqR(3,1) = t1015+t1028+t1057*t1116-t1116*t1158-t1037*(qL3*(t1167-t1176+(t28*t224*t1009*t1041*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0)-qR3*(t1167-t1176+(t28*t224*t1009*t1041*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0))+iGR2_3*sqrtGR*t193*t1122-iGL2_3*sqrtGL*t192*(t936+t967+(t295*t404*(t539+alpha*t95*t224*t246*t297*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)+alpha*t105*t224*t247*t289*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)*2.0))/4.0+(t295*t429*(t804+(t43*t79*t224*t244*t251*t335*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0))/4.0+(t95*t224*t246*t281*t404*t429*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0)+iGR2_3*p0*sqrtGR*t862*(t277-t345)+Ku*t72*t164*t242*t862*(t936+t967+(t295*t404*(t539+alpha*t95*t224*t246*t297*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)+alpha*t105*t224*t247*t289*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)*2.0))/4.0+(t295*t429*(t804+(t43*t79*t224*t244*t251*t335*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0))/4.0+(t95*t224*t246*t281*t404*t429*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0)+Ku*t72*t164*t242*t863*t1122+(Ku*t72*t164*t224*t862*t863*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/4.0
      dFdqR(3,2) = t1037*(qL3*t1148-qR3*t1148)+t252*t1068*t1116+iGR2_3*sqrtGR*t196*t1062-Ku*t72*t164*t242*t863*t1062+Ku*iGvR1_3*sqrtGvR*t40*t72*t242*t862*t863
      dFdqR(3,3) = -t1037*(t1075-qL3*t1149+qR3*t1149)+t252*t1069*t1116+iGR2_3*sqrtGR*t196*t1063-Ku*t72*t164*t242*t863*t1063+Ku*iGvR2_3*sqrtGvR*t40*t72*t242*t862*t863
      dFdqR(3,4) = t1037*(qL3*t1146-qR3*t1146)+t252*t1066*t1116+iGR2_3*sqrtGR*t196*t1060+Ku*t40*t72*t242*t862*t863-Ku*t72*t164*t242*t863*t1060
      dFdqR(3,5) = t1044*t1116-t1116*t1138-t1037*(qL3*(-t1095+t1140+(t1037*t1039*t1042*(t1044-t1138))/2.0)-qR3*(-t1095+t1140+(t1037*t1039*t1042*(t1044-t1138))/2.0))+iGL2_3*sqrtGL*t192*t1103+iGR2_3*sqrtGR*t193*t1101+Ku*t72*t164*t242*t863*t1101-Ku*t72*t164*t242*t862*t1103-Rd*t22*t32*t103*t179*t195*t862-(Ku*Rd*t22*t58*t72*t77*t103*t164*t179*t195*t224*t862*t863)/4.0
      dFdqR(3,6) = t1015+t1028-t1116*t1154-t1037*(qL3*t1180-qR3*t1180)-iGL2_3*sqrtGL*t192*t1111+iGR2_3*sqrtGR*t193*t1120-(t28*t224*t461*t1009*t1116)/4.0-iGR2_3*p0*sqrtGR*t862*(t239-t343)+Ku*t72*t164*t242*t862*t1111+Ku*t72*t164*t242*t863*t1120+(Ku*t72*t164*t224*t461*t862*t863)/4.0
      dFdqR(4,1) = t1020+t1032+t1057*t1117-t1117*t1158-t1037*(qL4*(t1167-t1176+(t28*t224*t1009*t1041*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0)-qR4*(t1167-t1176+(t28*t224*t1009*t1041*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0))-sqrtGhL*t192*(t936+t967+(t295*t404*(t539+alpha*t95*t224*t246*t297*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)+alpha*t105*t224*t247*t289*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)*2.0))/4.0+(t295*t429*(t804+(t43*t79*t224*t244*t251*t335*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0))/4.0+(t95*t224*t246*t281*t404*t429*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0)+sqrtGhR*t193*t1122+p0*sqrtGhR*t862*(t277-t345)+Ku*t97*t164*t242*t862*(t936+t967+(t295*t404*(t539+alpha*t95*t224*t246*t297*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)+alpha*t105*t224*t247*t289*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196)*2.0))/4.0+(t295*t429*(t804+(t43*t79*t224*t244*t251*t335*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0))/4.0+(t95*t224*t246*t281*t404*t429*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0)+Ku*t97*t164*t242*t863*t1122+(Ku*t97*t164*t224*t862*t863*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/4.0
      dFdqR(4,2) = t1037*(qL4*t1148-qR4*t1148)+sqrtGhR*t196*t1062+t252*t1068*t1117-Ku*t97*t164*t242*t863*t1062+Ku*iGvR1_3*sqrtGvR*t40*t97*t242*t862*t863
      dFdqR(4,3) = t1037*(qL4*t1149-qR4*t1149)+sqrtGhR*t196*t1063+t252*t1069*t1117-Ku*t97*t164*t242*t863*t1063+Ku*iGvR2_3*sqrtGvR*t40*t97*t242*t862*t863
      dFdqR(4,4) = -t1037*(t1075-qL4*t1146+qR4*t1146)+sqrtGhR*t196*t1060+t252*t1066*t1117+Ku*t40*t97*t242*t862*t863-Ku*t97*t164*t242*t863*t1060
      dFdqR(4,5) = t1044*t1117-t1117*t1138-t1037*(qL4*(-t1095+t1140+(t1037*t1039*t1042*(t1044-t1138))/2.0)-qR4*(-t1095+t1140+(t1037*t1039*t1042*(t1044-t1138))/2.0))+sqrtGhL*t192*t1103+sqrtGhR*t193*t1101+Ku*t97*t164*t242*t863*t1101-Ku*t97*t164*t242*t862*t1103-Rd*t22*t62*t103*t179*t195*t862-(Ku*Rd*t22*t58*t77*t97*t103*t164*t179*t195*t224*t862*t863)/4.0
      dFdqR(4,6) = t1020+t1032-t1117*t1154-t1037*(qL4*t1180-qR4*t1180)-sqrtGhL*t192*t1111+sqrtGhR*t193*t1120-p0*sqrtGhR*t862*(t239-t343)-(t28*t224*t461*t1009*t1117)/4.0+Ku*t97*t164*t242*t862*t1111+Ku*t97*t164*t242*t863*t1120+(Ku*t97*t164*t224*t461*t862*t863)/4.0
      dFdqR(5,1) =  t1057*t1118-t1118*t1158-t1037*(qL5*(t1167-t1176+(t28*t224*t1009*t1041*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0)-qR5*(t1167-t1176+(t28*t224*t1009*t1041*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0))
      dFdqR(5,2) =  t1037*(qL5*t1148-qR5*t1148)+t252*t1068*t1118
      dFdqR(5,3) =  t1037*(qL5*t1149-qR5*t1149)+t252*t1069*t1118
      dFdqR(5,4) =  t1037*(qL5*t1146-qR5*t1146)+t252*t1066*t1118
      dFdqR(5,5) =  t1044*t1118-t1118*t1138-t1037*(t1075+qL5*(-t1095+t1140+(t1037*t1039*t1042*(t1044-t1138))/2.0)-qR5*(-t1095+t1140+(t1037*t1039*t1042*(t1044-t1138))/2.0))
      dFdqR(5,6) =  -t1118*t1154-t1037*(qL5*t1180-qR5*t1180)-(t28*t224*t461*t1009*t1118)/4.0
      dFdqR(6,1) =  t1057*t1119-t1119*t1158-t1037*(qL6*(t1167-t1176+(t28*t224*t1009*t1041*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0)-qR6*(t1167-t1176+(t28*t224*t1009*t1041*(t216+p0*sqrtGR*t40*t58*t77*(t277-t345)+qR6*sqrtGR*t16*t23*t40*t77*t196+cvv*qR6*sqrtGR*t23*t40*t58*t78*t196))/8.0))
      dFdqR(6,2) =  t1037*(qL6*t1148-qR6*t1148)+t252*t1068*t1119
      dFdqR(6,3) =  t1037*(qL6*t1149-qR6*t1149)+t252*t1069*t1119
      dFdqR(6,4) =  t1037*(qL6*t1146-qR6*t1146)+t252*t1066*t1119
      dFdqR(6,5) =  t1044*t1119-t1119*t1138-t1037*(qL6*(-t1095+t1140+(t1037*t1039*t1042*(t1044-t1138))/2.0)-qR6*(-t1095+t1140+(t1037*t1039*t1042*(t1044-t1138))/2.0))
      dFdqR(6,6) =  -t1037*(t1075+qL6*t1180-qR6*t1180)-t1119*t1154-(t28*t224*t461*t1009*t1119)/4.0
      
    end subroutine AUSM_jab
    
    ! Only use left side
    subroutine dpdq_vec(dpdq,sqrtGL,qN)
      real(r_kind), dimension(nVar), intent(out) :: dpdq
      real(r_kind)                 , intent(in ) :: sqrtGL
      real(r_kind), dimension(nVar), intent(in ) :: qN
      
      real(r_kind) :: qL1,qL2,qL3,qL4,qL5,qL6
      
      real(r_kind) :: &
      t2 ,&
      t3 ,&
      t4 ,&
      t5 ,&
      t6 ,&
      t7 ,&
      t10,&
      t8 ,&
      t9 ,&
      t11,&
      t12,&
      t13,&
      t14,&
      t15,&
      t16,&
      t17,&
      t19,&
      t20,&
      t18,&
      t21,&
      t22,&
      t23,&
      t24,&
      t27,&
      t25,&
      t28,&
      t26,&
      t29,&
      t30,&
      t31,&
      t32,&
      t33
      
      dpdq = 0
      
      qL1 = qN(1)
      qL2 = qN(2)
      qL3 = qN(3)
      qL4 = qN(4)
      qL5 = qN(5)
      qL6 = qN(6)
      
      t2 = qL1+qL6;
      t3 = qL6*qL6;
      t4 = -cpv;
      t5 = -cvv;
      t6 = 1.0/p0;
      t7 = 1.0/qL1;
      t10 = 1.0/sqrtGL;
      t8 = t7*t7;
      t9 = t7*t7*t7;
      t11 = cpd+t4;
      t12 = cvd+t5;
      t13 = qL6*t7;
      t14 = t13+1.0;
      t15 = 1.0/t14;
      t16 = t15*t15;
      t17 = eqv*t13*t15;
      t19 = t11*t13*t15;
      t20 = t12*t13*t15;
      t18 = t17+1.0;
      t21 = -t19;
      t22 = -t20;
      t23 = cpd+t21;
      t24 = cvd+t22;
      t27 = Rd*qL5*t6*t7*t10*t18;
      t25 = 1.0/t24;
      t28 = t2*t27;
      t26 = t25*t25;
      t29 = log(t28);
      t30 = t23*t25;
      t31 = t30-1.0;
      t32 = pow(t28,t30);
      t33 = pow(t28,t31);
      
      dpdq(1) = p0*(t29*t32*(t25*(qL6*t8*t11*t15-t3*t9*t11*t16)-t23*t26*(qL6*t8*t12*t15-t3*t9*t12*t16))-t30*t33*(-t27+Rd*qL5*t2*t6*t8*t10*t18+Rd*qL5*t2*t6*t7*t10*(eqv*qL6*t8*t15-eqv*t3*t9*t16)));
      dpdq(5) = Rd*t2*t7*t10*t18*t30*t33;
      dpdq(6) = p0*(t30*t33*(t27+Rd*qL5*t2*t6*t7*t10*(eqv*t7*t15-eqv*qL6*t8*t16))-t29*t32*(t25*(t7*t11*t15-qL6*t8*t11*t16)-t23*t26*(t7*t12*t15-qL6*t8*t12*t16)));

    end subroutine dpdq_vec
    
    subroutine dpdq_mtx(dpdq,sqrtG,iG,q)
      real(r_kind), dimension(nVar,nVar), intent(out) :: dpdq
      real(r_kind)                      , intent(in ) :: sqrtG
      real(r_kind), dimension(3,3)      , intent(in ) :: iG
      real(r_kind), dimension(nVar)     , intent(in ) :: q
      
      real   (r_kind), dimension(nVar) :: dpdq_vector
      
      call dpdq_vec(dpdq_vector,sqrtG,q)
      
      dpdq = 0
      dpdq(2,:) = sqrtG * iG(1,3) * dpdq_vector
      dpdq(3,:) = sqrtG * iG(2,3) * dpdq_vector
      dpdq(4,:) = sqrtG * iG(3,3) * dpdq_vector
      
    end subroutine dpdq_mtx
    
  END MODULE jab_mod
